bug-bash
[Top][All Lists]
Advanced

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

Re: bug-bash Digest, Vol 215, Issue 9


From: Budi
Subject: Re: bug-bash Digest, Vol 215, Issue 9
Date: Sun, 11 Oct 2020 16:26:58 +0700

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-request@gnu.org <bug-bash-request@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-request@gnu.org
>
> You can reach the person managing the list at
>       bug-bash-owner@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 <daniel@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-Jdjw@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
> ****************************************
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]