Bash scripts contain shell-specific instructions that may not be compatible with other Linux shells.
to specify that your script is written for the Bash shell, you need to add the line #!/bin/bash at the beginning of each script
How to read synopsis?
bold text type exactly as shown.
italic text replace with appropriate argument.
[-abc] any or all arguments within [ ] are optional.
-a|-b options delimited by | cannot be used together.
argument … argument is repeatable.
[expression] … entire expression within [ ] is repeatable.
1. Introduction
2. Definitions
3. Basic shell features
3.1 Syntax
Shell Operations
Quoting
Escape character: \, It preserves the literal value of the next character that follows, with the exception of newline
Single Quotes: (‘’’) preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.
Double Quotes: (‘”’) preserves the literal value of all characters within the quotes, with the exception of ‘$’, ‘`’, ‘\’, and, when history expansion is enabled, ‘!’.
Comments
a word beginning with ‘#’ causes that word and all remaining characters on that line to be ignored.
An interactive shell without the interactive_comments option enabled does not allow comments.
The interactive_comments option is on by default in interactive shells.
3.3 Shell functions
fname () compound-command [ redirections ]
or
function fname [()] compound-command [ redirections ]
arguments are passed like in command-line
3.7 Executing commands
3.7.5 Exit status
3.8. Shell scripts
The shell first searches for the file in the current directory, and looks in the directories in $PATH if not found there.