I have a bunch of slurm jobs that produce standard output and error files with this format:
<string>.<string>.<string>.<job_id>.ERR
where job_id is the job id assigned by slurm.
So to get these job ids I can:
cut -f 4 -d "." *.ERR
I'd like to pipe the output of this command to a loop that will run sacct -j <job_id> and grep which jobs have failed, using:
sacct -j <job_id> | grep "FAILED"
Can this be done in one command?