in reply to Re: At Last, a Useful Definition of "Scripting Language"
in thread At Last, a Useful Definition of "Scripting Language"
If C is your "get stuff done" language, why not say it's your scripting language?
Does a shell script have to have a #! line at the start, or is this just a nice-to-have to make sure the right shell executes it?
The shebang is there so you can say:
$ ./script.sh
Instead of:
$ bash script.sh
The shebang also makes it possible for other programs to execute the script without knowing what language the program is written in. For instance, Apache/mod_cgi just needs to fork() and exec() on anything specified as a CGI. No need to check the file extention or somesuch to line it up with a specific interpreter.
It is perfectly possible to leave the shebang out. You just have know what interpreter to use.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: At Last, a Useful Definition of "Scripting Language"
by PhilHibbs (Hermit) on Jan 26, 2005 at 11:50 UTC |