I have some files in a folder. By running the following command I can create a list with the filtered filenames ( test1, test2,test3) and pass it using xargs to a grep filtering command filter file in the command contains a few values to be filtered out.
ls -Art1 | grep test | xargs -L1 grep -vf filter > ouput
However when run this command output file contain the filtered result of test1, test2 and test3. All in one.
I would like to have separate file for each test1 > test1_output, test2 >test2_output,... so taking the xargs value and just add an extra string to it "_output" to generate an output filename