BASH Shell script - control block with if then else
Some examples.
if then else
Section titled “if then else”if [ "mp3" == "$section" ]; then echo mp3 section; else echo not mp3 section; fior on separate lines
if [ "mp3" == "$section" ] then echo mp3 section else echo not mp3 sectionfiCheck if a variable is empty
Section titled “Check if a variable is empty”if [[ -z "$FOO" ]]then echo FOO is emptyelse echo FOO is ${FOO}fi