[vox-tech] printing manpages and really temporary variables

Peter Jay Salzman vox-tech@lists.lugod.org
Mon, 12 May 2003 16:04:34 -0700


a few months ago i stumbled on something useful.  maybe other people
will find it useful too.

often i want to print manpages in very small font.  using enscript -f
Courier7, usually.

but doing so is a paper waster unless you start resizing the xterm since
by default, you'll get 80 characters per column.  to get the full width
of my printer, i use:

COLUMNS=120 man latex2rtf | enscript -f Courier7 -o /tmp/blah;  gv /tmp

i just learned about the first part of this recently.  apparently, when
you say:

   $ VAR=value program

VAR contains the value "value" until bash prints the next command line
prompt (i don't know how else to say this).  like this:

   $ VAR=value program    # VAR=value while program runs
   $                      # VAR no longer equals value

it's especially nice for using with, say, dpkg because doing this
doesn't upset the real value of COLUMNS.  for instance:


p@satan$ dpkg -l "tetex-base"
+++-==============-==============-============================================
ii  tetex-base     1.0.2+20011202 basic teTeX library files


p@satan$ COLUMNS=100 dpkg -l "tetex-base"
+++-===================-===================-======================================================
ii  tetex-base          1.0.2+20011202-3    basic teTeX library files


p@satan$ dpkg -l "tetex-base"
+++-==============-==============-============================================
ii  tetex-base     1.0.2+20011202 basic teTeX library files

the last one illustrates that COLUMNS is no longer equal to 100.  of
course, you could always resize the xterm to re-establish the value of
COLUMNS, but this way you don't have to.

anyway, i found this to be very useful...

pete

-- 
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D