Question: Please help me find the four problems with this script. Below is an example output of the script. tmoyer2@itis-3246:~/scripting-2$ ./4-case.sh usage: ./4-case.sh tmoyer2@itis-3246:~/scripting-2$ ./4-case.sh start
Please help me find the four problems with this script. Below is an example output of the script.
tmoyer2@itis-3246:~/scripting-2$ ./4-case.sh usage: ./4-case.shtmoyer2@itis-3246:~/scripting-2$ ./4-case.sh start Starting process tmoyer2@itis-3246:~/scripting-2$ echo $? 0 tmoyer2@itis-3246:~/scripting-2$ ./4-case.sh stop Stopping process tmoyer2@itis-3246:~/scripting-2$ ./4-case.sh restart Restarting process tmoyer2@itis-3246:~/scripting-2$ ./4-case.sh reload Reloading process tmoyer2@itis-3246:~/scripting-2$ ./4-case.sh magic Unrecognized command magic tmoyer2@itis-3246:~/scripting-2$ echo $? 255
Script:
#!/bin/bash
if [[ -z $1 ]] then echo "usage: $0
case "$1" in 'start' ) echo "Starting process" ;; 'stop' ) echo "Stopping process" 'restart' ) echo "Restarting process" ;; 'reload' ) echo "Reloading process" done exit 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
