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


Groups > gnu.bash.bug > #14252 > unrolled thread

propagating environment variable via internal command

Started byTomáš Čech <sleep_walker@gnu.org>
First post2018-06-20 15:25 +0200
Last post2018-06-20 15:25 +0200
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug


Contents

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

#14252 — propagating environment variable via internal command

FromTomáš Čech <sleep_walker@gnu.org>
Date2018-06-20 15:25 +0200
Subjectpropagating environment variable via internal command
Message-ID<mailman.2293.1529503653.1292.bug-bash@gnu.org>

[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

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web