Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Point out which lines contain errors and fix them please! Step 1: Create a new f

ID: 3839215 • Letter: P

Question

Point out which lines contain errors and fix them please!

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!!!" # Search for the words which can be matched by regex [^a]*ce # And save the output to file "Result" echo "The regex [^a]*ce can match the string(s):" > Result grep '^[^a]*ce$' Result lance ace brace decide piece -ENDHERE # Check the existence of file "Result" # Send the content in "Result" to your emailbox # $1 is replaced by your campusID ls mail $1

Explanation / Answer

#/bin/bash

echo "Try to find out some errors!!!"

echo "The regex [^a]*ce can match the string(s):" > Result
grep '[^a]*ce$' <<END>> Result
lance
ace
brace
decide
piece

END
#ls mail $1 < Result

#echo " The result has been sent to ${1}@student.gsu.edu"
echo "Congratulations! You have corrected all the errors"

You dont have a mail folder that why it is giving the error whenever those 2 lines are uncommented. make sure you have a mail folder and then uncomment and run. Apart from that it is working fine.