我的 bash 脚本将比较并从不同的两个文件中读取两个值。如果它们不相等,则脚本应取消 slurm 上的作业。我想我应该得到工作ID。但我不知道如何获取作业 ID 并在 bash 脚本中取消它。我怎样才能做到这一点?
#!/bin/bash
#read the the first line (lets suppose a) from file1.txt
#read the the third line (lets suppose b) from file2.txt
if (a != b); then
# get the job-ID
# cancel the job
fi