Case

From LQWiki
Jump to navigation Jump to search

Case is a logical switch, e.g. in the bash shell with the following syntax:

case "$1" in
  start)
    echo "starting"
    ;;
  stop)
    echo "stopping"     
    ;;
  *)
    echo "your parameter was not start or stop"
esac