Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14252

propagating environment variable via internal command

Path csiph.com!fu-berlin.de!usenet.stanford.edu!not-for-mail
From Tomáš Čech <sleep_walker@gnu.org>
Newsgroups gnu.bash.bug
Subject propagating environment variable via internal command
Date Wed, 20 Jun 2018 15:25:25 +0200
Lines 60
Approved bug-bash@gnu.org
Message-ID <mailman.2293.1529503653.1292.bug-bash@gnu.org> (permalink)
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b46rllkaqdzwekjd"
X-Trace usenet.stanford.edu 1529503654 10179 208.118.235.17 (20 Jun 2018 14:07:34 GMT)
X-Complaints-To action@cs.stanford.edu
Cc tomas.janousek@gooddata.com, jan.hruban@gooddata.com
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
Content-Disposition inline
User-Agent NeoMutt/20170912 (1.9.0)
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From 2001:4830:134:3::e
X-Mailman-Approved-At Wed, 20 Jun 2018 10:07:31 -0400
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14252

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,


when comparing strange behaviors of different shell implementations Tomas Janousek found this bug

When using BASH as sh shell...

  $ ls -l /bin/sh
  lrwxrwxrwx 1 root root 4 Jun 13 16:25 /bin/sh -> bash

...internal shell command `set' propagates environment variable to the process its running:

  $ /bin/sh
  sh-4.4$ VARIABLE=value set -o noglob
  sh-4.4$ env | grep VARIABLE
  VARIABLE=value
  sh-4.4$

The problem doesn't occur if BASH is not running in POSIX mode

  $ /bin/bash
  bash-4.4$ VARIABLE=value set -o noglob
  bash-4.4$ env | grep VARIABLE
  bash-4.4$


This seems to be inconsistent with other shells but mainly it looks wrong.

Best regards,

S_W

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

propagating environment variable via internal command Tomáš Čech <sleep_walker@gnu.org> - 2018-06-20 15:25 +0200

csiph-web