by darrenf · 7y ago · 0 comments
for set in *_data.csv ; do
num=${set/_*/}
success=${set/data/A}
if [ ! -e $success ] ; then echo $num ; fi
done
ETA: likely specific to bash, since I have no experience with other shells except for dalliances with ksh and csh in the mid-90s. for set in *_data.csv; do
[[ -f "${set/data/A}" ]] || echo "${set%_data.csv}"
done
Edit: though I just write it out like this for formatting on HN. In real life, that would just be a one-liner:for set in *_data.csv; do [[ -f "${set/data/A}" ]] || echo "${set%_data.csv}"; done
parallel -kj1 'f="{}"; [[ -f "${f/data/A}" ]] || echo $f' ::: *_data.csv