Article View: comp.unix.shell
Article #1864Re: C-Shell Question
From: Tony J Yeates
Date: Thu, 29 Nov 1990 20:59
Date: Thu, 29 Nov 1990 20:59
33 lines
1339 bytes
1339 bytes
athos@apple.com (Rick Eames) writes: >I am having a problem with a shell script that really does nothing, but >won't work anyway. >set x=1 >set y=10 >while ($x <=$y) > echo This does nothing. > @ x++ >end >when I run this script, it tells me that it didn't expect an end of file, >and get's the error one line greater than the actual number of lines in >the file. Don't know why it fails, but it does in csh & tcsh .... usually! If you do: csh <script name> it works! (You need to add a space between the >= and the $y tho') The fix is to add the shell selection line at the start, on the Sun I work on, my first line is "#!/bin/csh -f". Works fine! (Again don't know why - is it a bug, or are we missing something here?!) I think you should prob. use @ x = 1 and @ y = 10, rather than "set" - although it works without them. This seems like a black art sometimes!
Technical Details
Message-ID:
<5301@iron6.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!jarthur!uunet!motcid!yeatesReferences:
<11329@goofy.Apple.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!jarthur!uunet!motcid!yeates From: yeates@motcid.UUCP (Tony J Yeates) Newsgroups: comp.unix.shell Subject: Re: C-Shell Question Message-ID: <5301@iron6.UUCP> Date: 29 Nov 90 20:59:45 GMT References: <11329@goofy.Apple.COM> Distribution: na Organization: Motorola Inc., Cellular Infrastructure Div., Arlington Heights, IL Lines: 33