Step 1: Create a new file named as checkError.sh (vi checkError.sh or nano check
ID: 3827904 • Letter: S
Question
Step 1: Create a new file named as checkError.sh (vi checkError.sh or nano check Error sh), then include following lines in your checkError.sh. #/bin/bash /*m check Error Script echo Try to find out some errors Seach for the words which can be matched by regex al ce And save the output to file Result echo The regex al ce can match the string (s) Result grep al ces' END 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 Result $1 is replaced by your campusdD echo "The result has been sent to $11 Student gSu.edu echom Congratulations You have corrected all the errors! Or you can directly copy this file from my public directory to your current working directory by following command and then skip step 2Explanation / Answer
Correct script:
#!/bin/bash
#Check Error Script
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
-ENDHERE
ls mail $1 < Result
echo "The result has been sent to $1@student.gsu.edu"
echo "Congratulations! You have corrected all the errors!"
t
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.