home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / shell / 5499 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.6 KB

  1. 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
  2. From: ln_smr@pki-nbg.philips.de (Stephen Riehm)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: how to distinguish set command
  5. Message-ID: <ln_smr.728057987@pki-nbg.philips.de>
  6. Date: 26 Jan 93 14:19:47 GMT
  7. References: <1993Jan23.132103.1@vax1.umkc.edu> <18430003@hpfcso.FC.HP.COM>
  8. Sender: news@pki-nbg.philips.de
  9. Reply-To: ln_smr@pki-nbg.philips.de
  10. Lines: 33
  11.  
  12. mic@hpfcso.FC.HP.COM (Marc Clarke) writes:
  13.  
  14. >The "set" command with no options lists all currently set environment
  15. >variables.  The "set" command with options, such as "set -x" turns on
  16. >environmental options.
  17.  
  18. true, but I believe that what this guy wants to do is:
  19.  
  20.     set -- $some_var_with_args_in_it
  21.     while [ $# -ne 0 ]
  22.     do
  23.         check arg.
  24.     done
  25.  
  26. the -- is to tell the shell to stop processing options, and to start
  27. collecting pseudo command line args. This way, if $some_var_with_args_in_it
  28. is empty, there is no problem because -- acts as a dummy option, thus
  29. preventing the listing of all vars.
  30.  
  31. (there is also nothing to stop you combining the two, ie:
  32. set -x -- hello world )
  33.  
  34. catchya
  35.  
  36. --------------------------------------------------------------------
  37. Stephen Riehm           Configuration Management          _-_|\ 
  38. ln_smr@pki-nbg.philips.de  Philips Kommunikations Industrie  /     \
  39. Work: +49 911 526 2975       Nu"rnberg, Germany             \_.-.!/
  40. Fax:  +49 911 526 3678       "I was there, now I am here!"          v 
  41. "My company speaks another language, I CAN'T speak on its behalf"
  42. PS: You may think I am joking, I can't speak the language that well so
  43.         PLEASE DON'T REPLY IN GERMAN!
  44.              - thanks -
  45.