[nSLUG] Any Perl Experience around?

Joel Maxuel j.maxuel at gmail.com
Thu Jun 22 07:34:37 ADT 2017

I guess, after taking a quick peek online at colour types[1] and symbol
classification[2], there is not much overlap and I would be more concerned
for file type over class.  If I had the choice, type would make a standard
directory listing easier to look at (whereas class would be pretty bland).
All to identify files by (rough) type easily/visually without having to
sort by them either.

Also, I noticed after my 12:40 AM message, my Perl has also been dropping
results, including files with no escape characters to be found.


Joel Maxuel

"One should strive to achieve, not sit in bitter regret."
 - Ronan Harris / Mark Jackson

On Thu, Jun 22, 2017 at 6:50 AM, Joel Maxuel <j.maxuel at gmail.com> wrote:

> Off the top of my head, are the classification codes:
> / (Blue)
> * (Lime)
> ~ (Magenta)
> ...because I cannot remember there being more symbols but I do recall more
> colourization than four.  And my test directory, used colour more often
> within the types than the use of the codes (except for the directory
> marking which was probably the same).
> At any rate, I can think of a Case logic within the string (wherever it
> may be) to identify the class code.  Not sure how that lays out on paper
> though.
> Looks simpler at this point.
> Cheers,
> Joel Maxuel
> On Jun 22, 2017 1:05 AM, "Mike Spencer" <mspencer at tallships.ca> wrote:
>> > ls -F --color | perl -lne 's/(.{24}).*/$1... /s ; print' | column -x
>> >
>> > [and other variants...]
>> Use ls -F, pipe to perl, parse the classification chars in perl and
>> add colour codes yourself in the perl print statement.  (Note that ls
>> doesn't colorize the classification chars which you can elide or not
>> as you like.)
>> See man 4 console_codes, page down to ECMA-48 for the codes.  Run ls
>> --color in an Emacs shell buffer (dumb terminal) to see which ones ls
>> normally uses and how multiple codes are concatenated with ';'.
>> (E.g. directory names are coded for both blue and bold.)
>> Easier than trying to write a regexp to manipulate the raw ls --color
>> output.
>> FWIW,
>> - Mike
>> --
>> Michael Spencer                  Nova Scotia, Canada       .~.
>>                                                            /V\
>> mspencer at tallships.ca                                     /( )\
>> http://home.tallships.ca/mspencer/                        ^^-^^
>> _______________________________________________
>> nSLUG mailing list
>> nSLUG at nslug.ns.ca
>> http://nslug.ns.ca/mailman/listinfo/nslug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/pipermail/nslug/attachments/20170622/80862c45/attachment.html>

More information about the nSLUG mailing list