bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] Correct error message when using -n and -o ignoreeof in inte


From: Chet Ramey
Subject: Re: [PATCH] Correct error message when using -n and -o ignoreeof in interactive mode
Date: Wed, 21 Aug 2024 14:39:29 -0400
User-agent: Mozilla Thunderbird

On 8/21/24 12:09 PM, Grisha Levit wrote:
On Wed, Aug 21, 2024, 11:27 Chet Ramey <chet.ramey@case.edu <mailto:chet.ramey@case.edu>> wrote:

    On 8/19/24 9:52 AM, Ángel wrote:
     > On 2024-08-18 at 11:21 +0700, Robert Elz wrote:
     >> Interactive shells with -n (noexec) set are pointless
     >
     > The man page states:
     >>                -n      Read commands but do not execute them.  This
    may be used
>>                        to  check a shell script for syntax errors. This is ig‐
     >>                        nored by interactive shells.
     >
     > And indeed, doing a set -n on an interactive shell is ignored.
     > It is however possible to run an interactive noexec bash if it is set
     > on launch.

    It's not unreasonable to turn off that flag as part of interactive shell
    initialization.


I've found using

     bash --norc -in <<< INPUT

invaluable for testing input handling so I hope that remains an option.

Good point. I think I can make that work; maybe turn off noexec only if
stdin is a terminal or similar.

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