export i fails to work in bash

Bug #1951155 reported by Tianxing Yang
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I ran the following commands:
```
# In parent shell
export a=1
export i=2
bash # open child shell
# In child shell
echo $a # 1
echo $i # (empty)
exit
```

This bug happens when exporting the "i" variable from parent shell to child shell.
I have not tested what other variable names would trigger this bug.

* My OS: Ubuntu 20.04 LTS
* Bash version (running `bash --version`):
```
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
```

I have also tested in the `sh` shell and did not see the problem:
```
# In parent shell
export a=1
export i=2
sh # open child shell
# In child shell
echo $a # 1
echo $i # 2
exit
```

Tags: export
description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bash (Ubuntu):
status: New → Confirmed
Revision history for this message
Tianxing Yang (ytxmobile) wrote :

Still happening in 22.04 LTS.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.