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

  1. Path: sparky!uunet!cs.utexas.edu!usc!nic.csu.net!nic.csu.net!nntp
  2. Newsgroups: comp.unix.shell
  3. Subject: Re: Problem with ksh read built-in parsing
  4. Message-ID: <1993Jan22.202617.3918@nic.csu.net>
  5. From: oleg@gd.cs.csufresno.edu
  6. Date: 22 Jan 93 20:26:15 PST
  7. Sender: oleg@gd.cs.csufresno.edu
  8. References: <C1488r.HM1@boi.hp.com> <1993Jan20.151915.17141@b11.b11.ingr.com> <1993Jan22.131631.20334@cas.org>
  9. Organization: Computer Science Departement of California State University in Fresno
  10. Nntp-Posting-Host: gd.cs.csufresno.edu
  11. Lines: 33
  12.  
  13. In article <1993Jan22.131631.20334@cas.org> lvirden@cas.org (Larry W. Virden) writes:
  14. >I have encountered strange interactions in functions where I attempted to
  15. >save off IFS and then restore it later.  I ended up using the practice
  16. >- which works for me in the sort term - of undefining IFS when I got
  17. >done inside of shell programs which needed to parse IFS.   This isn't
  18. >a great solution, but for some reason, certain programs would cease
  19. >working if I did something like:
  20. >
  21. >OIFS="$IFS"
  22. >IFS=:$IFS
  23. >
  24. >do work
  25. >
  26. >IFS="$OIFS"
  27. >
  28. >return
  29. >
  30.  
  31. Many programs use system() or popen(), which launch a shell that inherits IFS
  32. (among other things) from parent's environment. As a result, shell can have problems
  33. parsing an argument. For example, if you add ; to IFS, man will screw up since it
  34. calls "cd /usr/cat?; $PAGER manpage" that gets changes to a meaningless cat command
  35. with 3 arguments.
  36.  
  37. Oleg
  38.  
  39. >
  40. >-- 
  41. >Larry W. Virden                 UUCP: osu-cis!chemabs!lvirden
  42. >Same Mbox: BITNET: lvirden@cas  INET: lvirden@cas.org
  43. >Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614
  44.  
  45.  
  46.