|
Thanks Keelba, from your program, I got it into one liner:
(echo "1.txt";echo "2.txt") | xargs zgrep -n STRING | awk -F: '{printf "%s %s", $1" -", $2 "\n"}'
Later:
xargs zgrep -n STRING | awk -F: '{printf "%s %s", $1" -", $2 "\n"}'
I placed the above line in a file: vv-grep
Then, I can run this script neatly as:
(echo "1.txt";echo "2.txt") | ./vv-grep
The final thing which I want to enhance here is only for the input string to be searched for, so that the program can be executed like:
(echo "1.txt";echo "2.txt") | ./vv-grep STRING
I am trying to find out how I can get input in command line parameter to the script.
Thanks for the great help. I was able to understand your suggestion and could mould it in the way I wanted.
It will be great if you could tell me if you know as how to get the input from comand line parameter to the script.
vvaidyan
|