Reputation: 1
I am trying to write a bash script, but I need multiple tabs in it or terminal. Is it possible to use that in a bash script. I need it, because I use a few commands that need to keep running.
Thank you all and sorry for my English!
Upvotes: 0
Views: 214
Reputation: 361585
To run a process in the background add &
at the end. For example, this runs ls
in the background and uses tail
to monitor the file that's being written to in the foreground.
ls -lR / > /tmp/ls.out &
tail -f /tmp/ls.out
If at any point you want to wait until the background processes are finished before continuing—perhaps at the end of your script before it exits—use a bare wait
command:
wait
Upvotes: 1