[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
error messages for [[ don't include "[[: " when a DEBUG trap is present
From: |
Emanuele Torre |
Subject: |
error messages for [[ don't include "[[: " when a DEBUG trap is present |
Date: |
Wed, 15 Jun 2022 19:52:40 +0200 |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin'
-DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc'
-DSYS_BASH_LOGOUT='/etc/bash.bash_logout'
-DNON_INTERACTIVE_LOGIN_SHELLS
uname output: Linux t420 5.15.46-1-lts #1 SMP Thu, 09 Jun 2022
10:12:44 +0000 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.1
Patch Level: 16
Release Status: release
Description:
When a DEBUG traps is present, error messages for `((' and `[['
commands don't contain "((: " or "[[: ".
Repeat-By:
bash-5.1$ bash -c '[[ ++ -gt 3 ]]' abc
abc: line 1: [[: ++: syntax error: operand expected (error token is "+")
bash-5.1$ [[ ++ -gt 3 ]]
bash: [[: ++: syntax error: operand expected (error token is "+")
bash-5.1$ bash -c 'trap echo\ hi DEBUG; [[ ++ -gt 3 ]]' xyz
hi
xyz: line 1: ++: syntax error: operand expected (error token is "+")
bash-5.1$ trap echo\ hi DEBUG; [[ ++ -gt 3 ]]
hi
bash: ++: syntax error: operand expected (error token is "+")
bash-5.1$ trap - DEBUG
bash-5.1$ (( -- ))
bash: ((: -- : syntax error: operand expected (error token is "- ")
bash-5.1$ trap echo\ hi DEBUG; (( -- ))
bash: -- : syntax error: operand expected (error token is "- ")
- error messages for [[ don't include "[[: " when a DEBUG trap is present,
Emanuele Torre <=