Is there a Bash equivalent of Z Shell's &!
(or &|
), i.e., immediately disown a job after it is started? I looked in Bash Reference Manual and searched in Google but can't seem to find anything relevant.
1 Answer
nohup <cmd>
should do the job for you
-
This question is not about how to disown a job immediately (I know how to do that, and I could put the
disown
on the same line and achieve essentially the same effect), but rather, if this is a feature of Bash (and if so, how).nohup
is a third party command, and it's certainly not a "Bash equivalent of Z Shell's&!
".– 4ae1e1Dec 9, 2014 at 19:07 -
-
Also,
nohup
redirects stdout and stderr to file if they are connected to a tty, so that's definitely not equivalent.– 4ae1e1Dec 9, 2014 at 19:09 -
"no, it's not a part of bash (that i know of)." That's also what I thought. Just to make sure.– 4ae1e1Dec 9, 2014 at 19:10
-
immediately disown job after it is started
, but in the comment to Sirex's answer you write:This question is not about how to disown a job immediately
. So, what is your question? Is something likesleep 20 & disown
or(sleep 20 &)
a solution to your problem? BTW what is your goal, that we don't run into another xy problem?&!
or&|
. Basically yes no answer. "This question is not about how to disown a job immediately" means I'm not interested in practical solutions because I know plenty. Maybe I should close this by now since I suppose the answer is no.