Problem with reading multiple lines from multiple files
Hi All,
I am having a problem while reading multiple lines from multiple files. I have two files in the directory sat test. File names are test1.txt & test2.txt. Contents of the files are: test1.txt: [~/test]$ cat test1.txt XYZ uniqueID ABC DEF Price 800 test2.txt: [~/test]$ cat test2.txt xyz uniqueID 900 def Price abc i want my code to grep multiple particular word from these 2 or multiple files of same type & process accordingly. But the code seems to not be working for multiple lines. Code is: Code:
#!/bin/bash [~]$ ./test21.sh Site Checked = test1 Uniq Hw IDs are : AUG is : Site Checked = test2 Uniq Hw IDs are : AUG is : Can somebody please suggest how to move forward with this. Thanks in Advance! BR\\Vijay |
Your grep commands don't have any input. Get rid of the while loop an just pass $file to each grep.
|
I am with the previous post. Your while loop is pointless as you do nothing with the read line anyway.
|
All times are GMT -5. The time now is 01:39 PM. |