Shell script that finds a word within a file selected by a user

view full story

http://stackoverflow.com – I am training to do shell scripting as a hobby, I was stumbled on a task I was given by my tutor. The task is to make a shell script that you can enter a file name you want to search in and then it will respond if it exists or not; then if it exists you have another option to find a certain word in the file that exist in there the certain word must be shown. Here is what I've done so far. My tutor only gave me a hint it has something to do with grep?? #!/bin/bash echo "search the word you want to find" read strfile echo "Enter the file you wish to search in" grep $strfile "strword" st (HowTos)