[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash: please provide an easy way to spawn a new process group from s
From: |
clime |
Subject: |
Re: bash: please provide an easy way to spawn a new process group from script |
Date: |
Sun, 1 Nov 2020 22:36:21 +0100 |
On Sun, 1 Nov 2020 at 21:23, Chet Ramey <chet.ramey@case.edu> wrote:
>
> On 11/1/20 5:13 AM, clime wrote:
>
> > Work with process groups should be natural in bash. It can't be that
> > complex. I struggled with this for several hours and found lots of
> > people on the net that struggled with the same problem too.
>
> It is natural, and job control is the most natural way to do it. If you
> don't want to use job control for some reason, the `setpgid' loadable
> builtin exists, as others have noted.
Job control doesn't seem to be a good solution in scripts when it has side
effects like changing the way signals are handled.
setpgid syntax looks way too complex and unusable for me anyway right now
because i need something which is supported by default.
>
> If you don't want to use the loadable builtin, you can easily write a
> standalone program that, when executed, becomes a process group leader
> and execs the remaining arguments.
That's very much something that I wouldn't want to do for a background
pipeline one-liner.
Anyway, I don't want to argue about this. If people here don't agree,
there is no point in it.
Best regards
clime
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/