Best way to cancel all the SLURM jobs from shell command output
squeue -u $USER | grep 197 | awk '{print $1}' | xargs -n 1 scancel
Check the documentation for xargs
for details. If scancel
accepts multiple job ids (it should), you may omit the -n 1
part.