home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3083 < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.8 KB  |  47 lines

  1. Path: sparky!uunet!mcsun!Germany.EU.net!unido!pki-nbg!hitkw14!smr
  2. From: smr@iti.org (Stephen Riehm)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: setting variable from script to current environment??
  5. Message-ID: <smr.711815589@hitkw14>
  6. Date: 22 Jul 92 14:33:09 GMT
  7. References: <1992Jul21.070212.16485@gbrmpa.gov.au>
  8. Sender: news@pki-nbg.philips.de
  9. Lines: 36
  10.  
  11. wayne@gbrmpa.gov.au (Wayne Amisano) writes:
  12.  
  13. >I am trying to write a script to set an environment variable in
  14. >my tcsh environment.  I could use an alias to do it, but would
  15. >much rather do it from a script.  What i need to do is, run a
  16. >script to change the value of one environment variable, but
  17. >every time i do this, it changes the variable in the spawned
  18. >process, but it then disappears when it dies.
  19.  
  20. if it is not possible to use an alias, ( because it is too complex or
  21. whatever ), try the following:
  22.  
  23. create your shell script
  24. create an alias along the lines of:
  25.     alias <alias> 'source <script>'
  26.  
  27. where <alias> and <script> are substituted with reasonable values.
  28. This will solve your problem, because the current process runs the
  29. script, and not a subshell!
  30.  
  31. >-- 
  32. >Wayne Amisano (VK4KT)     _-_|\\    E-Mail - wayne@gbrmpa.gov.au
  33. >Great Barrier Reef       /     \\   Phone  - +61 77 81 8861 (GMT+1000)
  34. >Marine Park Authority.   \_.-._/    Fax    - +61 77 72 6093
  35. >Our's to use Wisely!          v     Mail   - GPO Box 1379, Townsville QLD 4810
  36.  
  37. Finally one of those character piccies of Aus. Wish I had one! ;-)
  38.  
  39. catchya
  40.  
  41. -----------------------------------------------------------------
  42. Stephen Riehm                   smr@pki-nbg.philips.de
  43. not in any way talking on behalf of:
  44. Philips Kommunikations Industrie      Phone: +49 911 526 2975
  45. 8500 Nuremberg, Germany                Fax: +49 911 526 2095
  46. I come from the land down under, where women glow and men chunder
  47.