I was going thru the man page of grep, and didn't see anything regarding variables, so I need to ask, can you use a variable with grep?
i.e. want to grep a file for all lines starting with H and V, but each time the file name will change. Dont want to have to keep re-typing the command line.
grep ^H file1.file && grep ^V file1.file >> outputfile
grep ^H file2.file && grep ^V file2.file >> outputfile
...and so on. Is there a way to have a variable so that all i have to do is throw this grep command into a txt file, slap a chmod +x on it so it will run, and then just simply type the script name with new filename to search?
Hope that all made sense.