Since the Bourne Again SHell is a superset of sh, all sh commands will also work in bash – but not vice versa. bash has many more features of its own, and, as the table below demonstrates, many features incorporated from other shells.
Tag: script
Bash common features
The following features are standard in every shell. Note that the stop, suspend, jobs, bg and fg commands are only available on systems that support job control.
Bash catching signals
Your system contains a man page listing all the available signals, but depending on your operating system, it might be opened in a different way.
Bash functions
Shell functions are a way to group commands for later execution, using a single name for this group, or routine. The name of the routine must be unique within the shell or script. All the commands that make up a function are executed like regular commands.
Bash select menu and shift
The select construct allows easy menu generation.
Bash repetitive tasks ( for , while , until )
To run a specific task or list of commands repetitively on bash script , you need to use on of this three constructions : for , while , until . Each one fits different situation as we will know now.
Bash conditional if and case statements
At times you need to specify different courses of action to be taken in a shell script, depending on the success or failure of a command. The if construction allows you to specify such conditions.
How to use awk
AWK is another popular stream editor, just similar to SED. The basic function of awk is to search files for lines or other text units containing one or more patterns. When a line matches one of the patterns, special actions are performed on that line.
How to use SED stream editor
A Stream EDitor ( SED ) tool is used to filter text that it gets from a pipeline feed. You do not need to interact with the editor while it is running; that is why sed is sometimes called a batch editor. This feature allows use of editing commands in scripts, greatly easing repetitive editing
Bash Variables
Variable is a temporary store for a simple piece of information, making it easier to use and manage in scripts. Tow actions that we do with variables is setting a value for the variable, or reading its value .