在Sun Grid Engine中指定作业工作目录。

huangapple go评论82阅读模式
英文:

Specify job working directory in Sun Grid Engine

问题

我可以在脚本中使用-cwd标志来指定脚本目录也是作业的工作目录。所以基本上我有两个选择:

  • 指定-cwd并将脚本目录设置为作业目录
  • 省略-cwd并不显式地设置作业目录

在后一种情况下,我的作业将在由我的$HOME值指定的目录中运行。
我的问题是如何指定作业的工作目录。例如,假设我有以下目录:

|main----------|sub----mydata.txt
|--myscript.sh

我的脚本内容如下:

#!bin/bash
tail mydata.txt -n 1 > output.txt

如果我指定-cwd标志,那么作业将失败 - 因为在我的main目录中没有mydata.txt - 它在名为sub的目录中找到。我尝试在我的主命令之前添加以下命令:

export $HOME=main/sub

但它仍然不起作用。

英文:

I can use -cwd flag in the script to specify that the script directory is also the job working directory. So I basically have two options:

  • specify -cwd and set the script directory as the job directory
  • omit -cwd and do not explicitly set job directory

In the latter case, my job is run in directory specified by my $HOME value.
My question is how can I specify job working directory. For example, suppose I have the following directory:

|main----------|sub----mydata.txt
|--myscript.sh

With the contents of my script being:

#!bin/bash
tail mydata.txt -n 1 > output.txt

If I specify flag -cwd then the job will fail - since there is no mydata.txt in my main directory - it's found in directory named sub. I've tried adding the following commands before my main command:

export $HOME=main/sub

But it still does not work.

答案1

得分: 1

使用**-wd**选项。 不需要C。

英文:

Use the -wd option. No c required.

huangapple
  • 本文由 发表于 2023年7月3日 17:23:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76603439.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定