Date: Sun, 27 Aug 2000 23:02:17 -0700 (PDT) From: Dima Dorfman <dima@unixfreak.org> To: Claude Cormier <techsupport@devises-or.com> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Newbie need help to execute a shell script Message-ID: <20000828060217.727F01F17@static.unixfreak.org> In-Reply-To: <39A9FBA2.6CE94BED@devises-or.com> from Claude Cormier at "Aug 28, 2000 01:41:54 am"
next in thread | previous in thread | raw e-mail | index | archive | help
> I am trying to execute a small shell script and always received the > "command not found" error. > > This is the "display" shell script: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > # This script displays the date, time, username and > # current directory. > echo "Date and time is:" > date > echo > echo "Your username is: `whoami` \\n" > echo "Your current directory is: \\c" > pwd > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > I am trying this from a tcsh shell. When I start a Bourne shell and type > the same "display" command, I get "no such file or directory". > > The "display" script is in my path and it has "rwx" permissions. > > I even try ./display while sitting in the directory where the script is, > but to know avail. > > Any suggestions... this is probably very basic... but remember I am a > newbie with Unix. You need to put ``#!/bin/sh'' at the top so the system knows that it's a shell script, and which shell to execute it with. So it'd look something like: [START] #!/bin/sh echo "Date and time: `date`" <the rest> [END] Change ``/bin/sh'' to whatever shell you want it to be run with. Hope this helps -- Dima Dorfman <dima@unixfreak.org> Finger dima@unixfreak.org for my public PGP key. "A problem well stated is a problem half solved." -- Charles F. Kettering To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000828060217.727F01F17>