Xref: utzoo comp.unix.shell:1269 comp.unix.ultrix:5865 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!bu.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.shell,comp.unix.ultrix Subject: Re: reading stdin for tcsh script Keywords: script, stdin Message-ID: <1991Jan17.141348.2044@athena.mit.edu> Date: 17 Jan 91 14:13:48 GMT References: <4909@media-lab.MEDIA.MIT.EDU> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 44 Your shell script is not working because it is being evaluated by the bourne shell, not by the C shell. If you want your shell script to be evaluated by the C shell, then put "#!/bin/csh -f" as the first line of the script (and hope that either your kernel or your shells understand the "#!" notation; I believe ultrix does). Here's the script without a shell specification at the top: % cat test echo Enter NAME : set title = $< echo Name : $title Here's what happens when you run it: % ./test Enter NAME : ./test: syntax error at line 3: `newline' unexpected Now we put a shell specification at the top: % ed test 53 1i #!/bin/csh -f . w 67 q And run it again: % ./test Enter NAME : John Doe Name : John Doe % -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710