I'm (another) newbie in bash scripting (my second day).
I'm trying to locate a phrase in a number of files (multiple files in subdirectories) replace this phrase with another one
and produce an output that contains the filename of the search string occurrence, the row in that file and the changed row.
In order to feed with files my search command I use
find "$TopDir" -type f | xargs ......
I have build the following command in order to locate the phrase that I'm looking for and produce FILENAME and line number.
Thanks for the reply but I'm a little lost.
What the redirection /dev/null 2 is? And a 2nd redirection after that?
Can we direct output in two directions at the some time?
That's my main problem as I cannot figure out how I'm going to produce a report file (filename - file line number - new line content) and on the some time to direct my output to each file that needs to be changed.