|
From: | |
Subject: | Re: issue with vredir6.sub and AIX - bash (sub-shell) is crashing durig manual replication of test |
Date: | Thu, 15 Oct 2020 15:11:54 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 |
On 15/10/2020 08:03, Michael Felt wrote:
Upon running "exec </dev/null", the standard input is no longer attached to your terminal emulator. Consequently, bash tries to read from /dev/null, only to encounter EOF. As there is no further input to be processed, it exits.$ exec </dev/null $ exit root@x065:[/data/prj/gnu/bash/bash-5.0.18] ``` As you can see by the return of the original PS1 - the sub-shell (./bash) 'crashed' -- I did not type 'exit' - that is a result of the 'exec </dev/null' command the line before.
You can prevent this from happening by running a script, or by using the -c option to convey the code. Doing so will launch a non-interactive instance of bash that does not read commands from the standard input.
Incidentally, it is not a subshell but an ordinary subprocess. -- Kerin Millar
[Prev in Thread] | Current Thread | [Next in Thread] |