Re:Problem solving with Unix commands
by kritixilithos on Friday February 15, 2019 @02:25AM
(#19169117)
Actually the following is even shorter
/A/{N;d;}
So all together this gives the following ls|sed '/A/{N;d;}'
Given a sorted list of these files (through `ls` or otherwise) the following sed code will print out the data files for which A did not succeed on them.
This works on the fact that there exists a data file for all successful and unsuccessful runs on data, so sed simply prints the files for which there does not exist an `A` counterpart.If you want to only print out the numbers, you can add a substitution or two towards the end.
Edit: fixed the sed program