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)

おすすめ記事