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