[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: reading HOWTO files

On Sun, Jan 04, 1998 at 07:08:17PM -0500, Scott K. Ellis wrote:
> On Sun, 4 Jan 1998, Catouch wrote:
> > I have had great success, so far installing and configuring my Debian system. 
> > However, I cannot access the HOWTO files.  They are in /usr/doc/HOWTO and are
> > gz.  How can I read them?  Thank you.
> If you've installed less, the 'zless' command will view compressed files.
> Otherwise, 'zcat file.gz | more' will also work.  If you have the less
> from hamm installed, the lesspipe program provides a way to get less to
> view compressed files without intervention.

The easiest solution to this is indeed to set up the lesspipe program,
which is very simple. Just put something like

LESSOPEN='|/usr/bin/lesspipe %s'

in your /etc/profile or ~/bash_profile. The file /usr/bin/lesspipe is
supplied by the less package. It contains this 'case' statement, which
shows what files you can view with it (besides, of course, plain text
files) and what it does with them before piping them into `less':
      # Decode file for less
      case "$1" in
            if [ -x /usr/bin/unarj ]; then unarj -v $1; else echo "No unarj available"; fi ;;

            echo "$1:"; dpkg --info $1; /bin/echo -e '\n*** Contents:'; dpkg-deb --contents $1 ;;

            if [ -x /usr/X11R6/bin/identify ]; then /usr/X11R6/bin/identify $1;
            else /bin/echo -e "No identify available\nInstall ImageMagick to browse images"; fi ;;

            tar tzvf $1 ;;

            gzip -dc $1 ;;

            tar tvf $1 ;;

            if [ -x /usr/bin/unzip ]; then unzip -v $1; else echo "No unzip available"; fi ;;

    esac ) 2>/dev/null

After you have set the LESSOPEN variable, commands like these actually
give you some readable information:
$ less some-package.deb
$ less *HOWTO.gz
$ less some-file.tar.gz

If you can't beat your computer at chess, try kick-boxing

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: