• bash/ksh differences (fg and other job control commands) (Was: (bash) H

    From Kenny McCormack@21:1/5 to janis_papanagnou+ng@hotmail.com on Mon Oct 7 13:19:17 2024
    In article <ve0lmv$1nkmd$1@dont-email.me>,
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
    ...
    Incidentally Bolky/Korn notes: "When a command in this
    section [Job Control] takes an argument called /job/, /job/ can be
    a process id." - I don't know about Bash, but Kornshell at least
    seems to have done it right.

    FWIW, I just tested with the "ksh" on this system, and fg does accept a pid argument.

    So, yes, ksh seems to have gotten it right. Note that ksh seems to have
    lots of different versions and forks, so I have no idea what exactly I was testing. I assume you could test on whatever version you normally use.

    So, it sounds like I actually have two possible bugs to report to the bash maintainers:
    1) The original thread topic - why the most recently launched job
    doesn't (always) become the "current job" (under certain
    circumstances). The problem is I haven't really identified what those
    circumstances are.

    2) Why fg doesn't take a pid arg. Note that a lot of the bash design
    is based on features originally implemented in ksh and so they do pay
    attention to how ksh does things.

    --
    The randomly chosen signature file that would have appeared here is more than 4 lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL:
    http://user.xmission.com/~gazelle/Sigs/CLCtopics

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Kenny McCormack on Mon Oct 7 18:12:40 2024
    On 07.10.2024 15:19, Kenny McCormack wrote:
    In article <ve0lmv$1nkmd$1@dont-email.me>,
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
    ...
    Incidentally Bolsky/Korn notes: "When a command in this
    section [Job Control] takes an argument called /job/, /job/ can be Correction: the chapter was "Operating System - Job Control" (and not
    the also existing chapter "Job Control").
    a process id." - I don't know about Bash, but Kornshell at least
    seems to have done it right.

    FWIW, I just tested with the "ksh" on this system, and fg does accept a pid argument.

    So, yes, ksh seems to have gotten it right. Note that ksh seems to have
    lots of different versions and forks, so I have no idea what exactly I was testing.

    Newer versions support ksh --version to get that information.
    I'm used to type <Esc> <Ctrl-V> (in Vi-mode, with set -o vi
    defined).

    I assume you could test on whatever version you normally use.

    The book I mentioned is old, so I expect that any ksh93 version
    (and all derived versions) to behave that way. Moreover, there's
    also not the typical remark about "availability in newer systems
    only", so there's a good chance that it was already existing in
    the ksh88 versions - I wouldn't bet on any early clone, though.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)