내가 오류오류가 bash는 스크립트의 문서
코드 3 개 원격 서버가 여기에 문서를 사용하여 배열을 사용하여 다음 명령 집합을 실행하려고하지만, 받고 있어요 -
을ssh -oPasswordAuthentication=no [email protected]${SERVER[i]} <<-END_TEXT
VALUE=`cat /home/cognos/cognos/c8/configuration/cogstartup.xml | grep -i xsd:long | head -1 | cut -d">" -f2 | sed 's/[:/<|crn:value]*//g'`
VALUE_BACKUP=$VALUE
........................ (many more lines of code)
RESULT1=`perl -e '@stats = stat("/home/cognos/cognos/c8/configuration/signkeypair"); print ((time - $stats[9]) < '$VALUE');'`
END_TEXT
그리고 오류 :
가**error -**
syntax error at -e line 1, near "<)"
Execution of -e aborted due to compilation errors.
syntax error at -e line 1, near "<)"
Execution of -e aborted due to compilation errors.
syntax error at -e line 1, near "<)"
Execution of -e aborted due to compilation errors.
PS- SSH를 사용하여 원격 서버에 명령을 복사하는 SCP를 사용하여 다음 실행이 아니오 내가 찾던 해결책.
힌트 :'cat - << - END_TEXT ... '를 사용하여 변수 치환이이 문서 내에서 어떻게 작동하는지 알아보십시오. – wildplasser
구문 오류가'(더 많은 코드 줄)'에 묻힐 가능성이 매우 높습니다. –
-e를 사용하는 perl 명령을 추가했습니다. 실행되는 동안 (더 많은 코드 줄에) 구문 오류가 없습니다. 제대로 로컬 즉 내가 ssh를 사용하지 않을 때. –