Re: Request For Enhancement - TID variable

2019-12-26 Thread Eric S. Raymond
Daniel Colascione :
> Are you sure that'd help? Parallel runs bash in a bunch of subprocesses, so
> looking at PID would suffice to distinguish jobs. Are you sure you weren't
> seeing an invariant PID because you were letting the PID variable expansion
> happen too early?

The $$ is inside the script. I don't see how it could be later.

Rerunning the command, I think I misinterprteted the error messages before.  
The script is a wrapper around another script that is calling svnadmin to
create a Subversion repository.  svnadmin doesn't like something about 
its calling context and is complaining that it can't write a directory
atomically.

Not bash's problem.  Carry on!
-- 
http://www.catb.org/~esr/";>Eric S. Raymond





Re: Fwd: Don't set $?=130 when discarding the current command line (not run yet) with CTRL-C?

2019-12-26 Thread Chet Ramey
On 12/23/19 9:54 PM, Clark Wang wrote:
> Hi Chet,
> 
> On Fri, Nov 22, 2019 at 12:02 AM Chet Ramey  > wrote:
> 
> On 11/20/19 9:27 PM, Clark Wang wrote:
> > It's quite common for people to press CTRL-C to discard the current
> command
> > line. This is harmless actually for most times except when people 
> include
> > $? in $PS1. I also show $? in red color when it's not 0 so it's more
> > noticeable. So is it OK to not change $? when people are pressing
> CTRL-C to
> > discard the input?
> 
> This behavior dates from at least 2009 and was added at user request so
> they could tell exactly that: whether or not entering the last command had
> been interrupted by a signal.
> 
> 
> I don't know how many people count on this behavior. Is it possible this be
fixed?

There is nothing to `fix'; this is the intended behavior.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: Request For Enhancement - TID variable

2019-12-26 Thread Andreas Schwab
On Dez 26 2019, Eric S. Raymond wrote:

> RFE: bash should have a TID varuable that returns the vakue of gettid(2).

Bash doesn't use threads, so $TID will always be the same as $BASHPID.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



Re: Request For Enhancement - TID variable

2019-12-26 Thread Daniel Colascione

On 12/26/19 7:37 AM, Eric S. Raymond wrote:

In attempting to use GNU parallel, with some bash scripts, I
discovered I had a problem with tempfile collisions due to
all of the thread having the same PID.

I was able to come up with a workaround, but...

RFE: bash should have a TID varuable that returns the vakue of gettid(2).

If the bash devs are too busy for this like the idea, I could write
the patch.


Are you sure that'd help? Parallel runs bash in a bunch of subprocesses, 
so looking at PID would suffice to distinguish jobs. Are you sure you 
weren't seeing an invariant PID because you were letting the PID 
variable expansion happen too early?




Request For Enhancement - TID variable

2019-12-26 Thread Eric S. Raymond
In attempting to use GNU parallel, with some bash scripts, I
discovered I had a problem with tempfile collisions due to 
all of the thread having the same PID.

I was able to come up with a workaround, but...

RFE: bash should have a TID varuable that returns the vakue of gettid(2).

If the bash devs are too busy for this like the idea, I could write
the patch.
-- 
http://www.catb.org/~esr/";>Eric S. Raymond

During waves of terror attacks, Israel's national police chief will
call on all concealed-handgun permit holders to make sure they carry
firearms at all times, and Israelis have many examples where
concealed permit holders have saved lives.
-- John R. Lott