So I am going to post a question about shell scripting again.
Problem Definition: For all files under a dir, ex.:
- A_anything.txt, B_anything.txt, ……
I want to execute a script, say ‘CMD’, on each of them, with the output files named like:
- A_result.txt, B_result.txt, ……
In addition, at the first line of these output file, I want to have the file name of the original one.
The ‘find -exec’ util seems to me unable to extract part of the file name.
Does someone know a solution to this problem, by any means(shell, python, find,etc)? Thank you!
HTH