bash cannot switch background/foreground for aplay

2020-03-06 Thread Chao Song

Hi, Bash Developers,

    I found that bash cannot switch background/foreground for aplay.

To reproduce:

    1. run aplay: aplay -Dhw:0,0 -f dat -i -c2 -vvv ./somewave.wav

    2. press CTRL + Z to switch to background

    3. press fg to switch to foreground.  [Failed at this step, seems 
aplay not in foreground, because output for aplay is not resumed.]


   Not sure if this is a bug of aplay or bash, could you please to take 
a look at bash first?


Thanks,

Chao




Re: bash cannot switch background/foreground for aplay

2020-03-06 Thread Chet Ramey
On 3/6/20 1:57 AM, Chao Song wrote:
> Hi, Bash Developers,
> 
>     I found that bash cannot switch background/foreground for aplay.
> 
> To reproduce:
> 
>     1. run aplay: aplay -Dhw:0,0 -f dat -i -c2 -vvv ./somewave.wav
> 
>     2. press CTRL + Z to switch to background
> 
>     3. press fg to switch to foreground.  [Failed at this step, seems aplay
> not in foreground, because output for aplay is not resumed.]

This is shaky logic.

> 
>    Not sure if this is a bug of aplay or bash, could you please to take a
> look at bash first?

Is any other process, including bash, getting read access to the terminal?
If not, how can this be a bash bug?

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



An exported function is malformed if it contains a nested function definition with heredoc

2020-03-06 Thread Sherwood Wang
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-2bxm7h/bash-
5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall
-Wno-parentheses -Wno-format-security
uname output: Linux hostname 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1
(2020-01-26) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.0
Patch Level: 3
Release Status: release

Description:

A function containing a nested function definition with heredoc
cannot be serialized into the environment variable correctly,
and leads to failures in a subshell.

See also: 
https://stackoverflow.com/questions/60564674/exporting-a-function-with-a-nested-function-definition-and-heredoc-in-bash

Repeat-By:

Create a script:

#!/bin/bash

f() {
g() {
cat <

Re: An exported function is malformed if it contains a nested function definition with heredoc

2020-03-06 Thread Chet Ramey
On 3/6/20 9:48 AM, Sherwood Wang wrote:

> Bash Version: 5.0
> Patch Level: 3
> Release Status: release
> 
> Description:
> 
>   A function containing a nested function definition with heredoc
>   cannot be serialized into the environment variable correctly,
>   and leads to failures in a subshell.

This was fixed back in July, the result of

https://lists.gnu.org/archive/html/bug-bash/2019-06/msg00063.html

and the fix is in the devel branch.

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