Use (setsid yourcommand &), it detaches from the tty and works equally in interactive and script modes.
( spawns a subshell, which handles job control differently.
Or use nohup yourcommand > /dev/null 2>&1 &
Tags
- Linux
- Shell
- Bash
Use (setsid yourcommand &), it detaches from the tty and works equally in interactive and script modes.
( spawns a subshell, which handles job control differently.
Or use nohup yourcommand > /dev/null 2>&1 &
Tags