Bug 11822 - ~ not expanded properly in variable settings when export is used
Summary: ~ not expanded properly in variable settings when export is used
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: bash   
(Show other bugs)
Version: 1.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-06-01 16:00 UTC by Jonathan Kamens
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-06-28 01:55:00 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Jonathan Kamens 2000-06-01 16:00:44 UTC
I have bash-2.04-3.  Watch this:

> sh -c 'FOO=~/scripts; echo $FOO'
> sh -c 'export FOO=~/scripts; echo $FOO'
> bash -c 'FOO=~/scripts; echo $FOO'
> bash -c 'export FOO=~/scripts; echo $FOO'

In short, ~ is not expanded properly by bash in variable settings preceded
by "export" when bash is invoked as "sh".

This is such a weird bug that I can't believe it isn't somehow intentional,
but on the other hand, I can't imagine why this behavior would be
implemented intentionally.

Comment 1 Bernhard Rosenkraenzer 2000-06-26 19:51:37 UTC
I've forwarded this to the bash maintainers to make sure it's a bug before
fixing it.

Comment 2 Jonathan Kamens 2000-06-28 01:54:58 UTC
The bash maintainers claim that this is not a bug because the behavior is
required by POSIX, and when bash is invoked as "sh" it runs in POSIX compliant
mode.  I think that in this case, the POSIX standard is wrong, but it's unlikely
to change, so I suppose you should go ahead and close this as NOTABUG.

Comment 3 Bernhard Rosenkraenzer 2000-07-19 17:30:16 UTC
Yes, POSIX compliance is not a bug. ;)

Note You need to log in before you can comment on or make changes to this bug.