home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / aixl / 2121 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.4 KB  |  41 lines

  1. Newsgroups: bit.listserv.aix-l
  2. Path: sparky!uunet!noc.near.net!ns.draper.com!news.draper.com!MVS.draper.com!SEB1525
  3. From: SEB1525@MVS.draper.com (Steve Bacher)
  4. Subject: Re: Q: csh and brackets in a script
  5. Message-ID: <19930125105104SEB1525@MVS.draper.com>
  6. Sender: MVS NNTP News Reader <NNMVS@MVS.draper.com>
  7. Nntp-Posting-Host: mvs.draper.com
  8. Reply-To: seb1525@draper.com
  9. Organization: Draper Laboratory
  10. References: <AIX-L%93012508472743@PUCC.PRINCETON.EDU>
  11. Date: Mon, 25 Jan 1993 15:51:00 GMT
  12. Lines: 27
  13.  
  14. In article <AIX-L%93012508472743@PUCC.PRINCETON.EDU>,
  15. Hubert Partl <partl@HP01.BOKU.AC.AT> writes:
  16.  
  17. >If you want $tolower to be evaluated by the shell as a complete
  18. >command (tr with arguments), you have to use eval.
  19. >
  20. >From my head (I did not test it) it should look similar to
  21. >  echo "abcABC" | eval "$tolower"
  22. >or without the double quotes, I don't know...
  23.  
  24. I tried it on SunOS, and you need the double quotes, but for
  25. some reason SunOS 4.1.1 insists on putting the job in the background
  26. instead of doing the tr, when you include the eval.  If you do
  27.  
  28.   eval echo "abcABC" "|" "$tolower"
  29.  
  30. then it works but still puts the whole line in as a background job.
  31.  
  32. The best fix is to go back to the original script and change the
  33. FIRST line from #!/bin/csh to  #!/bin/sh (and change "set tolower..."
  34. to "tolower=...".
  35.  
  36. No wonder csh is considered harmful...
  37.  
  38. --
  39. Steve Bacher (Batchman)                 Draper Laboratory
  40. Internet: seb@draper.com                Cambridge, MA, USA
  41.