Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 990249 - variable assignment fails with some nested substitutions
Summary: variable assignment fails with some nested substitutions
Keywords:
Status: CLOSED DUPLICATE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ksh
Version: 5.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Hlavinka
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-30 16:43 UTC by Donald Berry
Modified: 2018-12-03 19:28 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-31 15:09:50 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Donald Berry 2013-07-30 16:43:38 UTC
Description of problem:
variable assignment fails with some nested substitutions.  This worked previously with ksh-20100202-1.el5.

Version-Release number of selected component (if applicable):
ksh-20100621-12.el5

How reproducible:
Always

Steps to Reproduce:
1.
[root@vm5 ~]# rpm -q ksh
ksh-20100621-12.el5
[root@vm5 ~]# ksh
# USER=root
# ORACLE_SID=CDIRECT_PROD
# TOTO=$(cat << EOF
> $USER/$(uname -n)@$ORACLE_SID
> EOF
> )
# echo TOTO: $TOTO
TOTO:
2.
3.

Actual results:
variable is not set

Expected results:
with ksh-20100202-1.el5 the variable was set

Additional info:
This does not occur with all nested substitutions, but it does occur with cat:

[root@vm5 ~]# cat test.ksh 
#!/bin/ksh
USER=root
ORACLE_SID=CDIRECT_PROD
UNAME=$(uname -n)

TOTO=$(cat << EOF
$(uname -n)
EOF
)
echo TOTO 1: $TOTO

TOTO=$(echo $(uname -n))
echo TOTO 2: $TOTO
[root@vm5 ~]# ./test.ksh 
TOTO 1:
TOTO 2: vm5
[root@vm5 ~]#


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