[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"jobs" doesn't consistently expand function arguments

From: Keith Thompson
Subject: "jobs" doesn't consistently expand function arguments
Date: Mon, 23 Jul 2018 16:54:34 -0700

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib  -Wdate-time
-fstack-protector-strong -Wformat -Werror=format-security -Wall
-Wno-parentheses -Wno-format-security
uname output: Linux bomb20 4.15.0-24-generic #26-Ubuntu SMP Wed Jun 13
08:44:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.4
Patch Level: 19
Release Status: release

        The "jobs" command doesn't consistently expand function arguments

        For example:

        /bin/bash --login --noprofile
        bash-4.4$ nap() { sleep "$@" ; }
        bash-4.4$ nap 1234
        [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 &

The problem is the '"$@"' in the "jobs" output, which doesn't provide
any useful information.

This is on Ubuntu 18.04 LTS.
I've see the same problem with bash 5.0-alpha (built from source).

I'd prefer to see "sleep 1234" in the output of "jobs", though
"nap 1234" would also be ok.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]