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

History Miss United Kingdom

History and location Old Church of St Gwenllwyfo, Llanwenllwyfo

Partition of India Dominion of India