Zsh Mailing List Archive
Messages sorted by:
Re: nohup dies
- X-seq: zsh-users 11893
- From: Tim Haynes <zsh@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: nohup dies
- Date: Sat, 29 Sep 2007 12:01:29 +0100
- Cc: vim.unix@xxxxxxxxx
- In-reply-to: <30c383e70709290023x46dc7d13o2ff3904a05413496@xxxxxxxxxxxxxx> (Pau Amaro-Seoane's message of "Sat, 29 Sep 2007 09:23:34 +0200")
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <vim.unix@xxxxxxxxxxxxxx> <30c383e70709281338x1f2609dcsdc4dd7283d387c1c@xxxxxxxxxxxxxx> <200709282056.l8SKugEA000576@xxxxxxxxxxxxxxxxxxx> <30c383e70709290023x46dc7d13o2ff3904a05413496@xxxxxxxxxxxxxx>
- Reply-to: Tim Haynes <zsh@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Sender: Tim Haynes <piglet@xxxxxxxxxxxxxxxxxxxxxxxxxx>
"Pau Amaro-Seoane" <vim.unix@xxxxxxxxxxxxxx> writes:
>>zsh creates a pipeline
>> zsh forks:
>> In the subshell, "nohup cat ./input" is run
>> zsh forks again
>> In the new subshell, ~pau/executables/... is run
>>So the "nohup" doesn't cover the second executable.
> can you tell me of a more robust/elegant way of doing it?
Well, let's take your original command:
(nohup) cat ./input | ~pau/executables/NB4_NoPN > diagnostic&
Why not add a nohup before the second executable in the pipe? :
nohup cat ./input | nohup ~pau/executables/NB4_NoPN > diagnostic&
If you don't like that, then why not wrap the whole thing up in a new
invocation of a shell? :
nohup zsh -c 'cat ./input | nohup ~pau/executables/NB4_NoPN > diagnostic ' &
You could disown the job after it's been spawned, too.
While we're here, it should be observed that if you were disciplined or
pedantic enough not to be wasting a fork() running cat justonefile |, you
wouldn't have had this problem in the first place:
nohup ~pau/executables/NB4_NoPN < input > diagnostic &
> But zsh is supposed to emulate ksh, right?
And the polite bits of every other shell ;)
> the "solution" for now is to launch the simulation with ksh... or resort
> to screen... but it's a pity, I stick to zsh a lot
Screen has its place.
Messages sorted by: