This commit is contained in:
2025-04-13 12:13:32 +08:00
parent 5327c384ee
commit 848f34ef89
3 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
goto() {
# 获取作业的工作目录
workdir=$(scontrol show job "$1" | grep WorkDir | awk -F= '{print $2}')
# 检查路径是否存在
if [ -d "$workdir" ]; then
cd "$workdir" && echo "已跳转到作业 $1 的工作目录: $workdir"
else
echo "错误:无法定位作业 $1 的工作目录" >&2
return 1
fi
}
alias wdir="scontrol show job | grep WorkDir | awk -F= '{print $2}'"