#!/bin/sh # case.sh handle options with a case statement action="$1" # first command line argument case "$action" in start) echo "Starting service" ;; stop) echo "Stopping service" ;; restart) echo "Restarting service" ;; *) echo "Usage: $0 {start|stop|restart}" >&2 exit 2 ;; esac