Question: Step 1: Create a new file named as checkError.sh(vi checkError.sh or nano checkError.sh),then include following lines in your checkError.sh. #./bin/bash /* Check Error Script */
Step 1: Create a new file named as checkError.sh(vi checkError.sh or nano checkError.sh),then include following lines in your checkError.sh.
#./bin/bash
/* Check Error Script */
echo "Try to find out some errors!!!"
# Seach for the words which can be matched by regex [^a]*ce echo "The regex [^a]*ce can match the string(s):" > Result # And appendmatched strings to file "Result" cat << START| grep '^[^a]*ce$' > Result lance ace brace decide piece -END
# Thenappend the output of command simple.sh to file Result .simple.sh >> Result # Show current system date # And send the content in "Result" to your emailbox # $1 is replaced by your campusID date | mail $1 < Result
# $1 is replaced by your campusID
echo "The result has been sent to ${1}@student.gsu.edu"
echo "Congratulations! You have corrected all the errors!"
Step 2:Save your file and exit editor.
Step 3:Try following command to make simple.sh executable.
$chmod a+x simple.shStep
4:Execute this file by following command.$./checkError.sh campusID
Note: Replace campusID with your own campus ID
-----------------------
Questions: Can you find some errors when executing the commandin step 4? If yes, please point out which lines contain errorsand how to correct them
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
