This is a bash script written for an assignment in my Master's course.
A script that allows the user to search for specific lines in a log according to a pattern they provide and have these lines written to a new file for further use.
Prompts the user for:
1) The pattern to be searched for
2) Whether they want an whole word match or any match on the line
3) If they want to do an inverted match, i.e. retrieve lines that do not contain the pattern
If no match is found, report to the user “No matches found”.
If a match is found, echo the number of matches found, e.g. 5 matches found, and then each of matching word(s)/line(s) to the terminal with their corresponding line numbers in the source file.
The user has the option to do another search if he so wishes or exit the script.