I'm using diff to work out which files have already been processed and which are still to do. The input and output filenames are a little different, so I've used
sed to strip away the filepath and suffix information, so they can be compared.
TODO=$(diff -s <(basename -a ./data/*_R1_001.fastq.gz | sed 's/_R1.*//') <(basename -a ./results/repeats/*output.txt | sed 's/_repeats_output.*//')) echo $TODO
1d0 < MF3-130CAGiPSC-BL-20210521_S2_L001
Which is exactly what I want, except for the
1d0 < bit. I've been looking at the diff manual, and can't see how to get it to just output the filename and not it's default syntax (
1d0 <). Any help please!