[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Kevin Buchs
Subject: problem-solution
Date: Tue, 2 Feb 2021 10:52:40 -0600

Hello Bash People,

In my 20-ish years of using Bash, I have never once needed a component of a
pipeline to run in the base process, instead of in a subshell, until about
a week ago. Browsing around bashref, I found the lastpipe option and I
tried it, but it seemed to have no effect.

Rather than just submit a bug report, I thought I would try to dig in and
find the problem and try to fix it. When I downloaded the full bash source,
then I found in NEWS or CHANGES, that lastpipe was only available if job
control was disabled. Simplest case, just needed a documentation update.
But, I looked into that further and found the conditional in execute_cmd.c
which applies the restriction. Finding nothing else about that restriction,
I decided to try removing it. I found that the full test suite still
passed. My additional testing showed no flaws.

Of course, removing this restriction opens up the possibility that a user
can shoot themselves by trying to use job control at the same time. I think
that is a pretty rare case where one would want to do that, like, close to
never. I cannot believe even wanting to use job control with a non-lastpipe
pipeline is often done. It seems like the reward of having the feature
available for all interactive users is greater than the risk of someone
shooting themselves in the foot.

I know there is a legal process to go through to become a GNU contributor.
I did that a few years ago and I don't know if I am still in the system
from that time. In an effort to get you the changes I made (to code and
documentation) faster, and maybe simplify the process, I am here sharing
the changed files with you. You have my full permission to do whatever you
would like with these.

Note, I just subscribed to the bug-bash mailing list. I may not see replies
to the list only.

Kevin Buchs

Attachment: bash-contribution.zip
Description: Zip archive

reply via email to

[Prev in Thread] Current Thread [Next in Thread]