home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: bit.listserv.aix-l
- Path: sparky!uunet!noc.near.net!ns.draper.com!news.draper.com!MVS.draper.com!SEB1525
- From: SEB1525@MVS.draper.com (Steve Bacher)
- Subject: Re: Q: csh and brackets in a script
- Message-ID: <19930125105104SEB1525@MVS.draper.com>
- Sender: MVS NNTP News Reader <NNMVS@MVS.draper.com>
- Nntp-Posting-Host: mvs.draper.com
- Reply-To: seb1525@draper.com
- Organization: Draper Laboratory
- References: <AIX-L%93012508472743@PUCC.PRINCETON.EDU>
- Date: Mon, 25 Jan 1993 15:51:00 GMT
- Lines: 27
-
- In article <AIX-L%93012508472743@PUCC.PRINCETON.EDU>,
- Hubert Partl <partl@HP01.BOKU.AC.AT> writes:
-
- >If you want $tolower to be evaluated by the shell as a complete
- >command (tr with arguments), you have to use eval.
- >
- >From my head (I did not test it) it should look similar to
- > echo "abcABC" | eval "$tolower"
- >or without the double quotes, I don't know...
-
- I tried it on SunOS, and you need the double quotes, but for
- some reason SunOS 4.1.1 insists on putting the job in the background
- instead of doing the tr, when you include the eval. If you do
-
- eval echo "abcABC" "|" "$tolower"
-
- then it works but still puts the whole line in as a background job.
-
- The best fix is to go back to the original script and change the
- FIRST line from #!/bin/csh to #!/bin/sh (and change "set tolower..."
- to "tolower=...".
-
- No wonder csh is considered harmful...
-
- --
- Steve Bacher (Batchman) Draper Laboratory
- Internet: seb@draper.com Cambridge, MA, USA
-