procmail
[Top] [All Lists]

Re: Showing all env vars

2005-04-20 07:03:16
On Wed, 20 Apr 2005, Dallman Ross wrote:


This is pretty neat, I think.  I just discovered the second
thing below, by accident.


First, this one, which I've known for a while (and for which I
thank Mike Peeler):

 LOG = `env`

Sample output:

 TZ=Europe/Berlin
 LINEBUF=2048
 COMSAT=no
 LOGNAME=dman
 SHELL=/usr/local/bin/tcsh
 HOME=/net/u/1/d/dman
 PROCMAIL_VERSION=3.23pre+
 SENDMAILFLAGS=-oi
 SENDMAIL=/usr/sbin/sendmail
 SHELLFLAGS=-c
 MSGPREFIX=msg.
 LOCKEXT=.lock
 SHELLMETAS=&|<>~;?*[
 HOST=panix5.panix.com
 PATH=/net/u/1/d/dman/bin:/bin:/usr/local/bin:/usr/bin
 DEFAULT=/dev/null


But suppose you just want a list of all vars you've got
defined?  Well, obviously we could take the above and run
it through sed.  And then through sort.

Here's another way, though:

 SHELL = /bin/sh
 LOG = `dummy=; export $dummy`

All stripped and pre-sorted!  Here's the output:

 COMSAT
 DEFAULT
 HOME
 HOST
 LINEBUF
 LOCKEXT
 LOGNAME
 MAILDIR
 MSGPREFIX
 PATH
 PROCMAIL_VERSION
 SENDMAIL
 SENDMAILFLAGS
 SHELL
 SHELLFLAGS
 SHELLMETAS
 TZ

I'm going to use this at the end of some complex rcfiles I'm
writing in order to catalog all the vars I've created and placed
in use in that run.  Then I can use the list to write my documentation,
show what namespace I've appropriated, etc.

        ???  Be careful.  In my OS (Fedora1) I get quit different
        output:

export HOSTTYPE="i386-linux"
export LAMHELPFILE="/etc/lam/lam-helpfile"
export LESSOPEN="|/usr/bin/lesspipe.sh %s"
export LOGNAME="uuddii"
...

        Not only the "=" but the "export " too!  On Solaris9
        I got no output at all, that's right - you just set
        variable and export it.

Bye,
 Udi




(Note that the above is from a new, clean rcfile that has not had
any private env vars added yet.)

--
dman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail


+++++++++++++++++++++++++++++++++++++++++++
This Mail Was Scanned By Mail-seCure System
at the Tel-Aviv University CC.


---------------------------------------------------------------------------
Udi Mottelo - Unix System Administrator.
Faculty of Engineering - Tel-Aviv University
E-Mail: uuddii(_at_)eng(_dot_)tau(_dot_)ac(_dot_)il    Phone: +972-3-6408958
---------------------------------------------------------------------------


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>