英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论