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
    C is a generic programming language, with features deliberately left out because they can't be provided on all platforms (e.g. graphics). To me, a scripting language is an embedded language that controls the operation of that which it is embedded into. Hence, shell script is a language embedded into the shell. JavaScript is a language built into web browsers and web servers to provide programmatic access to their features.

    Perl is somewhat unusual, as it can be embedded into other applicatons, is designed to replace the existing scripting language that the shells provide, and also is a stand-alone language with wider capabilities.