최근에 Luster 시스템에서 Python 배치 작업을 실행하기 시작했습니다.
최근에 쉘 스크립트를 변경하여 오류가 발생했습니다.
awk: cmd. line:1: NR==
awk: cmd. line:1: ^ unexpected newline or end of string
스크립트는 다음과 같습니다.
#$ -cwd
# Define parallel environment for N cores
#$ -pe openmp 4
# Validation level (e = reject on all problems)
#$ -w e
# Merge stdout and stderr streams: yes/no
#$ -j yes
#name of job (human-friendly)
#$ -N experiment
# array job parameters below:
# which job IDs in the array to run, eg 1-5 or 3
#$ -t 1
# how many jobs of the array to run at a time
#$ -tc 15
MYFILE=all_experiment_parameters.txt.$RANDOM
python Get_Parameter_Settings.py > $MYFILE
SEED=$(awk "NR==$SGE_TASK_ID" $MYFILE)
echo $SEED
python RunExperiment.py $SEED
이것은 http://wiki.gridengine.info/wiki/index.php/Simple-Job-Array-Howto 섹션 '파일의 i 번째 줄에서 데이터 가져 오기'섹션에 제공된 예제의 구문과 유사합니다 .
누군가가 오류 메시지의 의미에 대해 조언 할 수 있습니까? (코드 중간을 가리킬 때 왜 '줄 바꿈 또는 문자열 끝'경고인지 이해할 수 없습니다)이 문제를 해결하는 방법은 무엇입니까? 이전에 작동했던 것처럼 실수로 만든 사소한 변경이라고 확신합니다.
SGE_TASK_ID가 설정되지 않은 이유를 깨달았습니다. 나는 사용하여 쉘 스크립트를 실행하고 있었다
./shell.sh
큐에 제출하는 대신
qsub shell.sh
그래서 완전 초보자의 실수입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다