There are around 20 files in a directory . Each file has the string $str
inside it.
I want to write a script that picks out that row containing the string $str
and dump into a file .
Each file should dump the searched row into a different file .
For example file1 dumps searched row to file called found1 and file2 dumps it to file called found2 etc....
Can anyone please guide me regarding this ?
I'm particularly finding it difficult to include the file name in the grep command.
I can't go on to include 20 grep commands.