Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash switch case

case $1 in
start)
    #Start logic
    ;;
stop)
    # Stop logic
    ;;
*)
	# Default logic
    echo $"Usage: $0 {start|stop}"
    exit 1
    ;;
esac
Source by linuxize.com #
 
PREVIOUS NEXT
Tagged: #bash #switch #case
ADD COMMENT
Topic
Name
3+5 =