[英]Cron Job not executing the Shell Script that has Command to execute as another user
[英]Basic Shell Script call command from another director with feedback
我正在嘗試創建一個shell腳本,以便它在2個單獨的目錄中調用兩個命令,然后顯示它們的反饋,要調用該命令,我猜它應該是這樣的./directory/ ./script.sh
提前感謝您的回復。
如果要順序調用命令:
/path/to/command1; /path/to/command2
如果僅在第一個命令成功的情況下才想調用第二個命令:
/path/to/command1 && /path/to/command2
如果要並行運行它們:
/path/to/command1 &
/path/to/command2
命令的輸出將是標准輸出(最有可能是終端)。 如果並行運行這兩個命令,它們會產生一些輸出,則可能需要將其重定向到其他文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.