December 2012
Intermediate to advanced
888 pages
48h 24m
English
The majority of shell scripts use a shebang line (#!) at the beginning to control the type of shell used to run the script; this bang line calls for an sh-incantation of bash:
#!/bin/sh
A shebang line (it is short for “sharp” and “bang,” two names for # and !) tells the Linux kernel that a specific command (a shell, or in the case of other scripts, perhaps awk or Perl) is to be used to interpret the contents of the file. Using a shebang line is common practice for all shell scripting. For example, if you write a shell script using bash but want the script to execute as if run by the Bourne shell, sh, the first line of your script contains #!/bin/sh, which is a link to the bash shell. Running ...
Read now
Unlock full access