home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7375 < prev    next >
Encoding:
Internet Message Format  |  1992-12-12  |  1.4 KB

  1. Path: sparky!uunet!gatech!concert!borg!rukbat!tell
  2. From: tell@rukbat.cs.unc.edu (Stephen Tell)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Changing environment variables
  5. Message-ID: <18322@borg.cs.unc.edu>
  6. Date: 12 Dec 92 05:28:09 GMT
  7. References: <1992Dec3.145051.23920@med.umich.edu> <WALT.92Dec10155038@bcarh1d7.bnr.ca>
  8. Sender: news@cs.unc.edu
  9. Organization: The University of North Carolina at Chapel Hill
  10. Lines: 26
  11.  
  12. In article <WALT.92Dec10155038@bcarh1d7.bnr.ca> walt@bcarh1d7.bnr.ca (Walt Sullivan) writes:
  13.  
  14. >One way to make changes to your shell's environment is to write your
  15. >Perl script so that the only thing(s) it outputs to stdout are "setenv
  16. >VARNAME varvalue ;setenv VARNAME2 varvalue2;", and do (via an alias,
  17. >if you like):
  18.  
  19. >eval `Perl_script`
  20.  
  21. If you do this for somthing you distribute far and wide, be sure it can
  22. alternately generate "VARNAME=value; export VARNAME" for people who use
  23. the One True Shell (sh).  Better yet, put the "export VARNAME" statements on
  24. a seperate line(s) so that when using the rc shell I can use
  25.  
  26. eval `{ Perl_script | grep -v '^export' }
  27.  
  28. >Walt Sullivan            INTERNET: walt@bnr.ca (work)
  29.  
  30. Just remember, "All the world is not a csh"
  31.  
  32. Steve
  33. -- 
  34. Steve Tell       tell@cs.unc.edu H: 919 968 1792  | #5L Estes Park apts
  35. UNC Chapel Hill Computer Science W: 919 962 1845  | Carrboro NC 27510
  36. Engineering is a _lot_ like art:  Some circuits are like lyric poems, some
  37. are like army manuals, and some are like The Hitchhiker's Guide to the Galaxy..
  38.