From owner-freebsd-questions Mon Aug 28 6:24:39 2000 Delivered-To: freebsd-questions@freebsd.org Received: from cogito.cam.org (Cogito.CAM.ORG [198.168.100.2]) by hub.freebsd.org (Postfix) with ESMTP id D8AF637B424 for ; Mon, 28 Aug 2000 06:24:33 -0700 (PDT) Received: from devises-or.com (Dialup-1144.HIP.CAM.ORG [205.205.139.195]) by cogito.cam.org (8.11.0/8.11.0.Beta1) with ESMTP id e7SDOJs11825; Mon, 28 Aug 2000 09:24:19 -0400 Message-ID: <39AA6722.B97AA3DC@devises-or.com> Date: Mon, 28 Aug 2000 09:20:34 -0400 From: Claude Cormier Organization: Ormetal Inc. X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en,fr MIME-Version: 1.0 To: dima@unixfreak.org Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Newbie need help to execute a shell script References: <20000828060217.727F01F17@static.unixfreak.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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`" > > [END] > > Change ``/bin/sh'' to whatever shell you want it to be run with. > > Hope this helps > > -- > Dima Dorfman > 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