nohup: 'source' 명령을 실행할 수 없습니다: nohup을 실행하는 동안 해당 파일이나 디렉터리 오류가 발생하지 않습니까?

nohup: 'source' 명령을 실행할 수 없습니다: nohup을 실행하는 동안 해당 파일이나 디렉터리 오류가 발생하지 않습니까?

SSH에서 로그아웃한 후 계속해서 명령을 실행하려고 합니다. 나는 명령 nohup source a.sh > a.txtscreen source a.sh > a.txt.을 사용했지만 둘 다 제공합니다

nohup: failed to run command 'source': No such file or directory```
error. In one question, it is said that use the absolute path of command but I couldn't find the exact location of source command. But I can use nohup directly with other commands such as cp. How can I solve this issue or are there better alternatives?

답변1

"소스"를 사용하는 이유는 무엇입니까? 이것만 하세요...

chmod 700 a.sh
nohup ./a.sh > a.txt & 

a.sh에서 인터프리터로 사용해야 하는 셸을 지정했는지 확인하세요. (예: #!/bin/sh)

관련 정보