[Top][All Lists]

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

When "set -u", "which" outputs environment: line 1: _declare: unbound

From: Craig Andrews
Subject: When "set -u", "which" outputs environment: line 1: _declare: unbound
Date: Fri, 09 Apr 2021 15:08:25 -0400

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection uname output: Linux craigatwork 5.11.11-300.fc34.x86_64 #1 SMP Tue Mar 30 16:37:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu

Bash Version: 5.1
Patch Level: 0
Release Status: release

With "set -u", invoking "which" results in the output of: environment: line 1: _declare: unboundvariable That should not happen, and does not happen, with prior versions of bash.
        I'm using Fedora 34 (beta).

        Run this shell script:
        set -u
        echo "$(which bash)"

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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