[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strange bash behavior
From: |
Chet Ramey |
Subject: |
Re: Strange bash behavior |
Date: |
Fri, 2 Dec 2016 05:59:13 -0800 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 |
On 12/2/16 1:20 AM, Clark Wang wrote:
> Found the problem. The first "bash -i" changed the foreground pgrp to its
> own pgrp at startup but did not restore the original foreground pgrp when
> it exited. The following patch (not a real fix) works for me:
>
> --- a/shell.c
> +++ b/shell.c
> @@ -1504,6 +1504,7 @@ open_shell_script (script_name)
> {
> e = errno;
> file_error (filename);
> + end_job_control ();
> sh_exit ((e == ENOENT) ? EX_NOTFOUND : EX_NOINPUT);
> }
Nice catch and fix. There are a couple of other places you need to make
this change, but it's the right fix.
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://cnswww.cns.cwru.edu/~chet/