Re: Bash-5.1-beta available

2020-10-07 Thread Andreas Schwab
On Okt 07 2020, Chet Ramey wrote:

> On 10/7/20 12:42 PM, Andreas Schwab wrote:
>> On Sep 10 2020, Chet Ramey wrote:
>> 
>>> h. Bracketed paste mode is enabled by default (for now).
>> 
>> Shouldn't that be disabled on a dumb terminal?  This wrecks havoc on the
>> gdb testsuite.  It sets TERM=dumb to tell readline not to do any fancy
>> output, but this no longer works.
>
> The gdb test suite tests pasting?

It uses expect.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



Re: Bash-5.1-beta available

2020-10-07 Thread Chet Ramey
On 10/7/20 12:42 PM, Andreas Schwab wrote:
> On Sep 10 2020, Chet Ramey wrote:
> 
>> h. Bracketed paste mode is enabled by default (for now).
> 
> Shouldn't that be disabled on a dumb terminal?  This wrecks havoc on the
> gdb testsuite.  It sets TERM=dumb to tell readline not to do any fancy
> output, but this no longer works.

Does gdb have access to set readline variables from its test suite? (Other
than specifying an INPUTRC file, of course.)

If so, it can run

rl_variable_bind ("enable-bracketed-paste", "off");


-- 
``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: Bash-5.1-beta available

2020-10-07 Thread Chet Ramey
On 10/7/20 12:42 PM, Andreas Schwab wrote:
> On Sep 10 2020, Chet Ramey wrote:
> 
>> h. Bracketed paste mode is enabled by default (for now).
> 
> Shouldn't that be disabled on a dumb terminal?  This wrecks havoc on the
> gdb testsuite.  It sets TERM=dumb to tell readline not to do any fancy
> output, but this no longer works.

The gdb test suite tests pasting?

-- 
``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: Bash-5.1-beta available

2020-10-07 Thread Andreas Schwab
On Sep 10 2020, Chet Ramey wrote:

> h. Bracketed paste mode is enabled by default (for now).

Shouldn't that be disabled on a dumb terminal?  This wrecks havoc on the
gdb testsuite.  It sets TERM=dumb to tell readline not to do any fancy
output, but this no longer works.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



Re: Broken $! behavior

2020-10-07 Thread Paul Fox
Thank you Chet - much appreciated.


On Wed, 7 Oct 2020 at 16:41, Chet Ramey  wrote:

> On 10/7/20 7:56 AM, Paul Fox wrote:
> > It seems like consecutive $! are mis-processed. This has always worked -
> > since csh days and bash 1.x. But sometime after 4.1 or 4.2, it got
> broken.
> > Heres my system info and version data
>
> Thanks for the report. The shell rejects the second history expansion
> because it takes it for a `$!' word expansion. I'll look at this after
> bash-5.1 is released.
>
> 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: Broken $! behavior

2020-10-07 Thread Chet Ramey
On 10/7/20 7:56 AM, Paul Fox wrote:
> It seems like consecutive $! are mis-processed. This has always worked -
> since csh days and bash 1.x. But sometime after 4.1 or 4.2, it got broken.
> Heres my system info and version data

Thanks for the report. The shell rejects the second history expansion
because it takes it for a `$!' word expansion. I'll look at this after
bash-5.1 is released.

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 process in command substitution

2020-10-07 Thread Chet Ramey
On 10/7/20 10:39 AM, Hyunho Cho wrote:
> There are cases that need not wait until background process finish

Thanks. I'll look at this for a future version.

-- 
``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: Things that work in bash-5.0 but not work in bash-5.1-rc1

2020-10-07 Thread Chet Ramey
On 10/7/20 3:50 AM, Hyunho Cho wrote:
> < bash-5.0 >
> 
> $ read rows cols < <(stty size)

These are all the same issue. It's the same thing described in

https://lists.gnu.org/archive/html/bug-bash/2020-09/msg00024.html

I'll see if there is a partial solution to the issue that doesn't require
stdin to be set to /dev/null. You end up with this weird hybrid: an
asynchronous non-job-control process still connected to the terminal.


> < bash-5.0 >
> 
> $ ( trap 'uname' CHLD; date )
> Wed Oct  7 16:39:55 KST 2020
> Linux
> 
> < bash-5.1-rc1 >
> 
> $ ( trap 'uname' CHLD; date )   # some strange warning messages appear
> Wed Oct  7 16:40:05 KST 2020
> Linux
> bash: warning: run_pending_traps: recursive invocation while running
> trap for signal 17

You're comparing a debug message from a non-release version with a release
version.

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/



background process in command substitution

2020-10-07 Thread Hyunho Cho
There are cases that need not wait until background process finish

--

In this case, zsh and bash wait 3 seconds to finish the assignment operation.
because sleep command's STDOUT is the pipe of command substitution.

< zsh >

$ AA=$( sleep 3 & date )# wait 3 seconds to finish

< bash >

$ AA=$( sleep 3 & date )# same as zsh



In this case, sleep command's STDOUT is redirected to FD 3
so there is no needs to wait 3 seconds
zsh return immediately with the value of background process PID
but bash still waits 3 seconds to finish the assignment operation.

< zsh >

$ exec 3>&1
$ PID=$(
date > >( sleep 3 >&3 ) & echo $!
)


< bash >

$ exec 3>&1
$ PID=$(
date > >( sleep 3 >&3 ) & echo $!
)



Broken $! behavior

2020-10-07 Thread Paul Fox
It seems like consecutive $! are mis-processed. This has always worked -
since csh days and bash 1.x. But sometime after 4.1 or 4.2, it got broken.
Heres my system info and version data

/home/fox/src/proc@allie: cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
/home/fox/src/proc@allie: help | head
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

 job_spec [&]history [-c] [-d offset] [n] or
hist>
 (( expression ))if COMMANDS; then COMMANDS; [ elif
C>
/home/fox/src/proc@allie: echo abc
abc
/home/fox/src/proc@allie: echo abc!$
echo abcabc
abcabc
/home/fox/src/proc@allie: echo !$!$
echo abcabc!$
abcabc!$

Something like "echo abc!$!$" works fine - but adjacent expansions
do not.

many thanks


Things that work in bash-5.0 but not work in bash-5.1-rc1

2020-10-07 Thread Hyunho Cho
< bash-5.0 >

$ read rows cols < <(stty size)

$ echo $rows $cols
19 95

< bash-5.1-rc1 >

$ read rows cols < <(stty size)
stty: 'standard input': Inappropriate ioctl for device

$ echo $rows $cols
   < empty

---

< bash-5.0 >

# emacs start with contents of ls command output
$ ls | emacs < /dev/tty --insert <(cat)

< bash-5.1-rc1 >

# emacs does not start with contents of ls command output
$ ls | emacs < /dev/tty --insert <(cat)

---

< bash-5.0 >

$ ( trap 'uname' CHLD; date )
Wed Oct  7 16:39:55 KST 2020
Linux

< bash-5.1-rc1 >

$ ( trap 'uname' CHLD; date )   # some strange warning messages appear
Wed Oct  7 16:40:05 KST 2020
Linux
bash: warning: run_pending_traps: recursive invocation while running
trap for signal 17