I have files with this name format:
<name1>.<name2>.<id>.ERR
where name1
and name2
are character
string
s and id
is a number and all three are unique to each file. (these are standard output files from a slurm
run, and id
is the job id).
I want to find out if these jobs failed so I was thinking of cut
'ing id
from each file name:
ls -1 *.ERR | cut -d "." -f 3
And then pasting "sacct -j "
in front of it.
Is there a one liner that achieves this so that it runs:
sacct -j id
1
sacct -j id
2
.
.
sacct -j id
n
Something like:
will work, if the files are not a lot (thousands). Replace echo blah blah with sacct -j, like this:
There are other ways too.