Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14391

Re: "jobs" doesn't consistently expand function arguments

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: "jobs" doesn't consistently expand function arguments
Date 2018-07-24 14:12 -0400
Message-ID <mailman.4152.1532455957.1292.bug-bash@gnu.org> (permalink)
References <CAAHpriOjfF1Y9XzfCRVmJM0-zJwhW11gP6bDVYsHq9zjBH2AkQ@mail.gmail.com>

Show all headers | View raw


On 7/23/18 7:54 PM, Keith Thompson wrote:

> Bash Version: 4.4
> Patch Level: 19
> Release Status: release
> 
> Description:
>         The "jobs" command doesn't consistently expand function arguments
> 
> Repeat-By:
>         For example:
> 
>         /bin/bash --login --noprofile
>         bash-4.4$ nap() { sleep "$@" ; }
>         bash-4.4$ nap 1234
>         ^Z
>         [1]+  Stopped                 sleep "$@"
>         bash-4.4$ bg
>         [1]+ sleep "$@" &
>         bash-4.4$ nap 2345 &
>         [2] 9666
>         bash-4.4$ jobs
>         [1]-  Running                 sleep "$@" &
>         [2]+  Running                 nap 2345 &
>         bash-4.4$
> 
> The problem is the '"$@"' in the "jobs" output, which doesn't provide
> any useful information.

This is how bash has behaved from its earliest days. The string associated
with the child process (the object that can be suspended) is the command
string before expansion.

Chet

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

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: "jobs" doesn't consistently expand function arguments Chet Ramey <chet.ramey@case.edu> - 2018-07-24 14:12 -0400

csiph-web