Execute background program in bash without job control
Posted
by
Wu Yongzheng
on Super User
See other posts from Super User
or by Wu Yongzheng
Published on 2012-06-11T09:30:59Z
Indexed on
2012/06/11
10:42 UTC
Read the original article
Hit count: 365
I often execute GUI programs, such as firefox and evince from shell. If I type "firefox &", firefox is considered as a bash job, so "fg" will bring it to foreground and "hang" the shell. This becomes annoying when I have some background jobs such as vim already running.
What I want is to launch firefox and dis-associate it with bash. Consider the following ideal case with my imaginary runbg:
$ vim foo.tex
ctrl+z and vim is job 1
$ pdflatex foo
$ runbg evince foo.pdf
evince runs in background and I get me bash prompt back
$ fg
vim goes foreground
Is there any way to do this using existing program? If no, I will write my own runbg.
© Super User or respective owner