(no subject)

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Bart Garst
Date:  
New-Topics: learning script
Subject: (no subject)
The first line of a shell script should be:
#!/bin/sh
where 'sh' can be the name of the shell you want to run the script
('bash' for example).

The reason it works with 'sh dw' is because you are launching the shell
'sh' with 'dw' as its argument.

Bart


On Sun, 2004-01-18 at 13:38, Michael Havens wrote:
> I am teying my hand at writing a basic script.
>
>     :
>     # @(#)dw -- <text> --
>     #
>     date
>     who -u

>
> So I type it in and then chmod 760 and after I try to execute it, it tells
> me:
>
>     command not found

>
> but it works if I 'sh dw' or 'sh<dw' any idea what's wrong? The current path
> is ~ and that is where the script is and I think that directory is searched
> first so there is no need for $PATH to be accessed.