Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-14 Thread Chet Ramey
On 7/12/19 5:19 PM, Andreas Schwab wrote:
> On Jul 12 2019, Chet Ramey  wrote:
> 
>> I assume this means that bc doesn't use strtod.
> 
> Of course not, strtod doesn't parse arbitrary precision numbers.

Yes, exactly.


-- 
``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: printf builtin retains timezone from un-set TZ environment variable

2019-07-14 Thread Chet Ramey
On 7/13/19 1:31 PM, Travis Everett wrote:

> Bash Version: 5.0
> Patch Level: 7
> Release Status: release
> 
> *Description:*
> I've noticed that a timezone explicitly set in the TZ environment variable
> can get cached (if any date-using command/builtin is run) and then show up
> (at least) in dates produced by the printf builtin's "%(...)T" formats even
> after the TZ variable is unset.

Thanks for the report. It's an easy fix.

-- 
``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: Multi-line Prompt/PS1 wrapping oddly

2019-07-14 Thread Chet Ramey
On 7/12/19 4:40 PM, Tianon Gravi wrote:

> What I've found is that if PS1 contains '\n' and the last line gets
> long enough for the cursor to be on the next line (for example, if \w
> gets too long), then typing will result in a single character being
> printed in the correct place followed by the cursor being moved to the
> next line.

Thanks for the report and the easy reproducer.

-- 
``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: Job-control not fully working in subshells since v4.4 ?

2019-07-14 Thread Chet Ramey
On 7/12/19 3:06 PM, Luca Landi wrote:

> Bash Version: 5.0
> Patch Level: 7
> Release Status: release
> 
> Description:
> 
> It appears that, since ca. v4.4, job-control from within an interactive 
> subshell
> is still allowed but does not work fully because the shell won't hand over
> foreground-ness.

Bash-4.4 is where the shell started to care about whether or not it was
running in the background for the purposes of giving away the terminal
to different process groups.

Your example is a case where the shell doesn't note the right value for
the shell's own process group. Adding that seems to fix the problem.

Chet

-- 
``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: background, pipeline, hang

2019-07-14 Thread Chet Ramey
On 7/13/19 5:55 AM, Mike Jonkmans wrote:

> This runs for two seconds:
>   bash --norc --noprofile -ic "trap 'tput hs' DEBUG; sleep 2 & :|:|:"
> 
> While this immediately finishes:
>   bash --norc --noprofile -ic "trap ':' DEBUG; sleep 2 & :|:|:"

I believe this has to do with running a process that forks from the DEBUG
trap while executing a pipeline.

Just another reason executing a DEBUG trap for a simple command that's run
as part of a pipeline is a bad idea.

This looks like a Linux-only problem, so I'll look when I have better
access to a Linux machine.

Chet

-- 
``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/