首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Slurm -歧义重定向

Slurm -歧义重定向
EN

Stack Overflow用户
提问于 2016-07-13 22:33:49
回答 1查看 367关注 0票数 0

我不知道slurm脚本有什么问题--当我试图定义变量时,接收到的错误消息对我的$input和命令都是不明确的重定向。

代码语言:javascript
复制
#!/bin/bash
#SBATCH --job-name=gim
#SBATCH --time=24:00:00
#SBATCH --ntasks=20
#SBATCH --ntasks-per-node=2
#SBATCH --cpus-per-task=1
#SBATCH -o output_%A_%a.out #Standard Output
#SBATCH -e output_%A_%a.err #Standard Error

module load program

input= gim${SLURM_ARRAY_TASK_ID}.gjf
output= gim${SLURM_ARRAY_TASK_ID}.log

program $input > $output

我管理它的方式是:

代码语言:javascript
复制
sbatch --array=1-500 ./slurm.job
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-07-13 22:38:11

白色空间很重要:

代码语言:javascript
复制
#!/bin/bash
# ...etc...

input=gim${SLURM_ARRAY_TASK_ID}.gjf
output=gim${SLURM_ARRAY_TASK_ID}.log

program "$input" > "$output"

注意,在赋值的=符号周围缺少空格。白色空间很重要:

代码语言:javascript
复制
foo = bar # this runs "foo" with "=" as the first argument and "bar" as the second
foo =bar  # this runs "foo" with "=bar" as its first argument
foo= bar  # this runs "bar" as a command with "foo" as an empty string in its environment
foo=bar   # this assigns the value "bar" to the shell variable "foo"
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38362811

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档