Richard's reply was a bit incomplete. Actually, you need to do 3 things to
make a script executable.

1. Make it executable from *the filesystem's* point of view. This means you
need to use chmod to set at least one execute bit -- for example, "chmod 755
somescript" will make it executable (and readable, needed for shell script
execution) by anyone. "Man chmod" for other options.

2. Make it executable from *its own* point of view. To do this, you include
in it an instruction that identifies the application that will run the
script. This is what you were half remembering, but you don't have it quite
right. For bash, you would use "#!/bin/bash" as the first line. You left out
the sharp (#) symbol.

3. Make it executable from *the user's* point of view. That is, put it where
it can be found for execution. This means either it goes in the PATH (which
you can check with the command "env"; you can verify that it is placed in
the user's PATH with the command "which somescript") or you have to run it
using a fully-qualified name (e.g., /home/someuser/somescript or, for the
pwd, ./somescript).

At 05:16 PM 4/22/99 -0400, Charles M Stapleton wrote:
>What has to be dome to a script to make it run by itself?
>
>I know that something like '!/bin/sh'  has to included at the beginning
[deleted]
------------------------------------"Never tell me the odds!"---
Ray Olszewski                                        -- Han Solo
762 Garland Drive
Palo Alto, CA  94303-3603
650.328.4219 voice                              [EMAIL PROTECTED]        
----------------------------------------------------------------

Reply via email to