bug-bash
[Top][All Lists]
Advanced

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

Re: !& error


From: Chet Ramey
Subject: Re: !& error
Date: Mon, 21 Aug 2023 16:18:35 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0

On 8/20/23 6:49 PM, Grisha Levit wrote:

Sorry if it was premature. Btw I'm not sure about the fix for this in https://git.savannah.gnu.org/cgit/bash.git/diff/execute_cmd.c?h=devel&id=b64a7d8c <https://git.savannah.gnu.org/cgit/bash.git/diff/execute_cmd.c?h=devel&id=b64a7d8c>

Running `! &' still causes the previous command (if any) to be displayed in `jobs' output:

$ : FOO
$ ! &
[1] 3938
$ jobs
[1]+ Done : FOO

I think this can be addressed by having print_simple_command produce at least an empty string even if the command has no words and no redirections.

I had fixed this in execute_simple_command with

  if (the_printed_command)
    the_printed_command[0] = '\0';

before the call to print_simple_command(), but I think I like yours better.

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




reply via email to

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