Shell Scripting In Linux, shells like bash and Korn support programming constructs that are saved as scripts. These scripts become shell com...
Shell Scripting
In Linux, shells like bash and Korn support programming constructs that are saved as scripts. These scripts become shell commands and hence many Linux commands are scripts.
SHELL environment variable is used to find the current shell
echo $SHELL
Shell Scripting She-bang
The sign #! is called she-bang and is written at top of the script. It passes instruction to program /bin/sh.
To run your script in a certain shell (shell should be supported by your system), start your script with #! followed by the shell name.
Example
Comments
Use # symbol to comment a code and the commented code does not get execute.
COMMENTS