bug-bash
[Top][All Lists]
Advanced

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

propagating environment variable via internal command


From: Tomáš Čech
Subject: propagating environment variable via internal command
Date: Wed, 20 Jun 2018 15:25:25 +0200
User-agent: NeoMutt/20170912 (1.9.0)

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

Attachment: signature.asc
Description: Digital signature


reply via email to

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