Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.unix.questions Subject: Re: csh question Message-ID: <1989Nov13.124916.2192@virtech.uucp> Date: 13 Nov 89 12:49:16 GMT References: <1989Nov13.014412.24735@Neon.Stanford.EDU> Distribution: usa Organization: Virtual Technologies Inc. Lines: 27 In article <1989Nov13.014412.24735@Neon.Stanford.EDU>, kamens@Neon.Stanford.EDU (Samuel N Kamens) writes: > if ($1 == foo) then > /usr/ucb/talk foo@bar > else > /usr/ucb/talk $1 > endif > > When I run it, I get an error (error: end of file unexpected). This works correctly under the csh, but gives the error you indicate when run under the borne shell, so you are probably not running it under the csh (even though you call it from the csh prompt). To ensure that the csh is used to process it, add the following to the beginning of the file: #!/bin/csh I believe the # must be in column 1. Note that this will not work when the user is using the borne shell as his command interpreter on most non-BSD based systems. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+