Date: Mon, 28 Aug 2000 09:20:34 -0400 From: Claude Cormier <techsupport@devises-or.com> To: dima@unixfreak.org Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Newbie need help to execute a shell script Message-ID: <39AA6722.B97AA3DC@devises-or.com> References: <20000828060217.727F01F17@static.unixfreak.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks Dima for answering...but it is getting weird.. I had tried of
course your suggestion which is to include #!/bin/sh as the firs line
and it didn't work..that is why I asked the question to the list.
But I tried also adding [START]...[END] in my script like you did...
even if I was sure that you put only to delemit the script... and here
is what my shell answers:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: not found
Date and time is:
[END]: not found
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So it looks like the shell is now finding my command but is having a
problem with the first line..I would have expected to received "[START]:
not found" as the first line. What is strange is that if I remove the
1st and last line in the script {START] and [END]... I get again the
message "command not found". ANy idea what is wrong with that shell?
CLaude
Dima Dorfman wrote:
>
> > 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 "Date and time is:"
> > echo "Date and time is:"
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > 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?39AA6722.B97AA3DC>
