I'm not sure you're missing anything. I think you're trying to search for a word or phrase in a file in a directory, and your code looks good to me.
Your approach works OK for me, although there was a small problem with a 'string too long' error, which was caused by the lack of an (exit) at the end, I think.
I think the search followed by read-line is going to print out the rest of the file, following the match. Is this what you want?
Ok. Adding (exit) eliminated the first error, but there are a couple more
problems. I want my script to spit out a bible verse from a directory
filled with one book per file, and one verse per line.
the single quotes around the argument did not work. I
got this error:
value expected in function search : file
I did parse out the arguments in my script, instead of
at the bash prompt, and it works without quoting anything.
Just in case anyone
wants to see the simple thing, here it is: