Bash serial execution of commands and exit on critical

If you want  to executue the shell commands serially in bash script but also want to keep checking and exit if  any of the command fails

set this at the top of your script

set -e
set -o pipefail


Conditional variable assignment/ substitution

Bash does support the conditional variable assignment/ substitution e.g.  below code snippet
#! /bin/bash
if [ “$name” != “Juned” ];then
echo  “hello $name”
echo “bye”
will define the variable name with second command line parameter , but if there is no second command line parameter then the name is defaulted to Juned