syslog stuff (was RE: wireless stoped working)

Matt Graham danceswithcrows at usa.net
Thu May 10 09:01:02 MST 2012


From: "Carruth, Rusty" <Rusty.Carruth at smartstoragesys.com>
[snip logrotate info]
> On a slightly different topic, I have found that some versions of 'less'
> will automatically decompress compressed files to text.  Or at least,
> one time I mistakenly said 'less /var/log/syslog*' when some of them
> were zipped, and LO! I didn't see any binary junk - it decompressed them
> for me.  YMMV!

This is actually found in *all* versions of less, at least since 1999, but the
environment variable that controls this feature isn't always set.  An older
Ubuntu didn't set it, f'rinstance.  That's:

export LESSOPEN='|lesspipe.sh %s'

...so less, when invoked, checks that LESSOPEN var and pipes files through
/usr/bin/lesspipe.sh , which checks the filename for a metric ton of common
patterns and attempts to invoke appropriate decompressers for those patterns. 
Like "bzip2 -dc" for files ending in .bz2 , "bzip2 -dc | tar tvvf -" for files
ending in .tar.bz2 , and so forth.

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see



More information about the PLUG-discuss mailing list