Textman is, self-explanatory, a text(Words and Letters) Inspector or a Bash script for searching text files with optionality.
- main_menu function: This function runs an infinite loop (
while true
) that presents the user with options to either search for words, count a string, count a letter or quit the script. After each action is completed, the user is returned to the main menu. - Returning to Main Menu: The
return
command in thefind_words
,count_string
andcount_letter
functions ensures that the script goes back to the main menu after executing these functions. - Exiting the Script: If the user enters 'q', the script exits.
- Make it executable with
chmod +x textman.sh
. - Run the script:
./textman.sh
.