home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!destroyer!gumby!yale!yale.edu!ira.uka.de!Germany.EU.net!pki-nbg!pki-nbg.philips.de!ln_smr
- From: ln_smr@pki-nbg.philips.de (Stephen Riehm)
- Newsgroups: comp.unix.shell
- Subject: Re: how to distinguish set command
- Message-ID: <ln_smr.728057987@pki-nbg.philips.de>
- Date: 26 Jan 93 14:19:47 GMT
- References: <1993Jan23.132103.1@vax1.umkc.edu> <18430003@hpfcso.FC.HP.COM>
- Sender: news@pki-nbg.philips.de
- Reply-To: ln_smr@pki-nbg.philips.de
- Lines: 33
-
- mic@hpfcso.FC.HP.COM (Marc Clarke) writes:
-
- >The "set" command with no options lists all currently set environment
- >variables. The "set" command with options, such as "set -x" turns on
- >environmental options.
-
- true, but I believe that what this guy wants to do is:
-
- set -- $some_var_with_args_in_it
- while [ $# -ne 0 ]
- do
- check arg.
- done
-
- the -- is to tell the shell to stop processing options, and to start
- collecting pseudo command line args. This way, if $some_var_with_args_in_it
- is empty, there is no problem because -- acts as a dummy option, thus
- preventing the listing of all vars.
-
- (there is also nothing to stop you combining the two, ie:
- set -x -- hello world )
-
- catchya
-
- --------------------------------------------------------------------
- Stephen Riehm Configuration Management _-_|\
- ln_smr@pki-nbg.philips.de Philips Kommunikations Industrie / \
- Work: +49 911 526 2975 Nu"rnberg, Germany \_.-.!/
- Fax: +49 911 526 3678 "I was there, now I am here!" v
- "My company speaks another language, I CAN'T speak on its behalf"
- PS: You may think I am joking, I can't speak the language that well so
- PLEASE DON'T REPLY IN GERMAN!
- - thanks -
-