[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] 'bash -n' without a script argument not ignored by inter
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] 'bash -n' without a script argument not ignored by interactive shell |
Date: |
Sun, 20 Jan 2019 15:01:11 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 |
On 1/19/19 8:35 PM, Alan D. Salewski wrote:
> Hi Folks,
>
> A friend stumbled over this surprising (to me) behavior the other day in
> which an invocation of:
>
> $ bash -n
>
> dropped him into an interactive shell in which no commands appeared to
> work. It was surprising (and somewhat comical) because the intention was
> not to create an interactive subshell at all, but rather to check the
> syntax on a script via what turned out to be a too-hastily-typed version
> of the intended command:
>
> $ bash -n path/to/somescript
>
> The appearance, however, was that the command I was directing him to
> type had hosed his (remote) shell session.
You can get out using ^D, for future reference.
It's kind of odd behavior, but most shells behave like this (except for
yash, which goes into an unkillable infinite loop).
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://tiswww.cwru.edu/~chet/