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!
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.