set -n not work as its supposed job to check validity of a command using Bash command inside a script ? for echo command checking
$ set -n 'echo HI' &&echo Y Y $ set -n 'eco HI' &&echo Y Y won't do the check, how to solve ? On 10/10/20, bug-bash-requ...@gnu.org <bug-bash-requ...@gnu.org> wrote: > Send bug-bash mailing list submissions to > bug-bash@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/bug-bash > or, via email, send a message with subject or body 'help' to > bug-bash-requ...@gnu.org > > You can reach the person managing the list at > bug-bash-ow...@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of bug-bash digest..." > > > Today's Topics: > > 1. Subject: Pressing Ctrl-C during any subshell evaluation > terminates the shell (Daniel Farina) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 9 Oct 2020 16:23:23 -0700 > From: Daniel Farina <dan...@fdr.io> > To: bug-bash@gnu.org > Subject: Subject: Pressing Ctrl-C during any subshell evaluation > terminates the shell > Message-ID: > <cacn56+ouyaq-4qhh+zkcugqnf+31cjuafgdon4cqtvgek-j...@mail.gmail.com> > Content-Type: text/plain; charset="UTF-8" > > Configuration Informatio: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -O2 -g -pipe -Wall -Werror=format-security > -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions > -fstack-protector-strong -grecord-gcc-switches > -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 > -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic > -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection > -Wno-parentheses -Wno-format-security > uname output: Linux shrike 5.8.9-200.fc32.x86_64 #1 SMP Mon Sep 14 18:28:45 > UTC 2020 x86_64 x86_64 x86_64 GNU/Linux > Machine Type: x86_64-redhat-linux-gnu > > Bash Version: 5.0 > Patch Level: 17 > Release Status: release > > Description: > > Pressing Ctrl-C during any subshell evaluation terminates the shell. I > noticed this when using direnv and emacs together: Ctrl-C would not cancel > a subprocess started by the shell, but would exit the entire shell. > > Relaying this from: https://github.com/direnv/direnv/issues/627 > > Repeat-By: > > Per https://github.com/direnv/direnv/issues/627#issuecomment-635611930 > > $ cat bash.rc > eval "$(direnv hook bash)" > > $ bash --rcfile bash.rc > bash$ echo $PROMPT_COMMAND > _direnv_hook > bash$ $(sleep 10) # pressing ^C during those 10 seconds will terminate the > shell > ^C > $ # inner shell terminated > > Fix: > > No known good fix. It does seem zsh manages the situation normally without > much difference in approach. Direnv 2.20.0 does not have this bug, but it > also has deficits in how it traps signals. > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > bug-bash mailing list > bug-bash@gnu.org > https://lists.gnu.org/mailman/listinfo/bug-bash > > > ------------------------------ > > End of bug-bash Digest, Vol 215, Issue 9 > **************************************** >