How to Execute multiple command using nohup
Wrap it in sh -c
:
nohup sh -c 'wget "$0" && wget "$1"' "$url1" "$url2" > /dev/null &
Wouldn't it be far simpler to create your list of commands in a separate shell file, e.g. command.sh, without any nohup.
Then you call:
nohup bash command.sh
Others have already answered about nohup
. As a practical side note: I recommend doing this kind of thing within a screen
or tmux
session. That way you can disconnect, then reconnect later and see the output and final result.