On Sun, 5 Mar 2000, Morten Bo Johansen wrote:

> >>> If your less displays the directory of a zip file then it's using an
> >>> input preprocessor through the LESSOPEN environment variable or a
> >>> script.
> > > 
> > > It does and you're right about the cause. I didn't even know that.
> > 
> > Could you tell me how it's being done on your site?
> 
> Yes, it's the default SuSE 6.2 setup that has the following lines in
> /etc/profile:
> 
> LESSOPEN="|lesspipe.sh %s"
> export LESSOPEN
> 
> and the script, lesspipe.sh, I have attached here.

Thanks. I knew about less' input preprocessor but had never tried it. I
added some other "cases" to the script:

     *.lzh|*.lha) lha v $1 2>/dev/null ;;
     *.arc|*.ark) arc v $1 2>/dev/null ;;
     *.rar) rar l $1 2>/dev/null ;;
     *.doc) catdoc -m78 $1 2>/dev/null ;;

And changed some others to fit my system:

     *.tar) tar tvf $1 2>/dev/null ;;
     *.t[ag]z|*.tar.gz|*.tar.[zZ]) tar tzvf $1 2>/dev/null ;;
     *.tar.bz2) tar tyvf $1 2>/dev/null ;;
     *.zip) unzip -v $1 2>/dev/null ;;

> Funnily enough it won't work for me with files having the extension
> *.tar.gz while it does work if the extension is *.tgz even if I believe I
> have the correct definitions in lynx.cfg, i.e.
> 
> VIEWER:application/x-tar-gz:less %s:NON_XWINDOWS
> VIEWER:application/x-gzip:less %s:NON_XWINDOWS
> 
> For *.tar.gz files it presents me with the alert that you cited
> earlier:
> 
> "/tmp/L2992-4TMP.html" may be a binary file.  See it anyway?
> 
> I wonder why that is.

Since lynx already handles the .gz extension by itself, try replacing the two
VIEWERs above with just

VIEWER:application/x-tar:less %s:NON_XWINDOWS

I prefer to define all those "viewers" in .mailcap instead of .lynx.cfg. For
tar files I use

application/x-tar; tar -tvf %s | $PAGER

With less' input preprocessor I could use

application/x-tar; less %s

Ismael
-- 
       ________________________________________________________________
      |                                                                |
      | ISMAEL CORDEIRO            | mailto:[EMAIL PROTECTED]        |
      | Production sound mixer     | http://ismael.cordeiro.com/       |
      | Montr�al - Qu�bec - Canada | ftp://ftp.pubnix.net/users/ismael |
      |________________________________________________________________|

Reply via email to