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

Discography Ole Paus

Gaeta class Lerici-class minehunter

Driver.27s licenses used for identification purposes Driver's license