eval and export behave differently together in dash and ash than in bash, zsh, and ksh

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

 



The script

eval export dir=~$LOGNAME
echo $dir

eval dir2=~$LOGNAME
echo $dir2

produces different results on different shells.

bash  (4.2-2ubuntu2.1) (with and without --posix)
zsh (4.3.17-1ubuntu1)
ksh (93u-1)
produce

/home/buildbot
/home/buildbot

dash (0.5.7-2ubuntu2)
ash (0.5.7-2ubuntu2)
produce

~buildbot
/home/buildbot

The easy workaround is to use the older form

eval dir=~$LOGNAME
export dir

but it'd be nice if that weren't needed.
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux