bug-bash
[Top][All Lists]
Advanced

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

export -p may output invalid variables


From: Stephane Chazelas
Subject: export -p may output invalid variables
Date: Fri, 09 May 2008 16:18:11 +0100

Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2 -Wall
uname output: Linux sc.homeunix.net 2.6.25-rc8 #1 PREEMPT Fri Apr 4 08:56:07 
BST 2008 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu

Bash Version: 3.2
Patch Level: 33
Release Status: release

Description:
  ~$ env -i '1=a' sh -c 'export -p'
  export 1="a"
  export OLDPWD
  export PWD="/home/chazelas"
  export SHLVL="1"
  ~$ env -i '1=a' bash -c 'export -p'
  declare -x 1="a"
  declare -x OLDPWD
  declare -x PWD="/home/chazelas"
  declare -x SHLVL="1"
  ~$ env -i '1=a' sh -c 'export -p' | sh
  sh: line 1: export: `1=a': not a valid identifier
  ~$ env -i '1=a' bash -c 'export -p' | bash
  bash: line 1: declare: `1=a': not a valid identifier

  ash/dash are also affected. zsh, pdksh, mksh, posh, ksh93 are not.


Repeat-By:
  see above.

Fix:
  only report about shell variables.




reply via email to

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