a little script
Chris F.A. Johnson
c.f.a.johnson-bJEeYj9oJeDQT0dZR+AlfA at public.gmane.org
Tue Jan 27 21:02:22 UTC 2004
On Tue, 27 Jan 2004, Tim Writer wrote:
> John Macdonald <jmm-TU2q2He6PgRlD5gtYiU6kEEOCMrvLtNR at public.gmane.org> writes:
>
> >
> > However, that first line is not totally a comment -
> > it can serve a functional purpose too. When the
> > first line of a text file starts with #! (in column
> > 1, no leading spaces) the rest of the line can be
> > used to indicate the program that will interpret
> > this script (in this case /bin/bash).
>
> Yes, I should have mentioned that. Perhaps it's worth pointing out that
> /bin/sh is the default if the script doesn't begin with #!.
That depends on how it is run.
If run from the bash command line, or from another bash script, it
will be executed by bash.
If run by at or cron (or pdksh), /bin/sh is used. Which in the
case of linux, is still bash, but the startup files will not be
read (see the INVOCATION section of the man page).
--
Chris F.A. Johnson
=================================================================
cfaj-uVmiyxGBW52XDw4h08c5KA at public.gmane.org http://cfaj.freeshell.org
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list