Conditional execution Bash (Unix shell)



where ./do_something executed if cd (change directory) command successful (returned exit status of zero) , echo command executed if either cd or ./do_something command return error (non-zero exit status).


for commands exit status stored in special variable $?. bash supports if ...;then ...;else ...;fi , case $variable in $pattern)...;;$other_pattern)...;; esac forms of conditional command evaluation.







Comments

Popular posts from this blog

Euro commemorative coin Melk Abbey

Discography Ole Paus

Other members of the DiMeo crime family List of The Sopranos characters in the Soprano crime family