View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Case

From LQWiki

Jump to: navigation, 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

Personal tools