Added background commands

The syntax looks ugly, but this is the optimal way to do it. It doesn't have any extraneous output due to the parenthesis surrounding the command, and also sends error output to /dev/null.
This commit is contained in:
CoolOppo
2018-06-27 21:39:04 -04:00
committed by GitHub
parent bdfd20a89a
commit ff4b3db9cb

View File

@@ -186,5 +186,16 @@ ls
command ls
```
<!-- CHAPTER END -->
## Run a command in the background
This will run the given command and keep it running even after the terminal is closed.
```sh
bkr() {
(nohup "$@" &>/dev/null &)
}
bkr ./some_script.sh # some_script.sh is now running in the background
```
<!-- CHAPTER END -->