*Synopsis*: *ksh93* problem with command substitution (within back quotes) containing \$'
CR 6710205 changed on Dec 23 2008 by <User 1-5Q-5151> === Field ============ === New Value ============= === Old Value ============= See Also 6437624 ====================== =========================== =========================== *Change Request ID*: 6710205 *Synopsis*: *ksh93* problem with command substitution (within back quotes) containing \$' Product: solaris Category: shell Subcategory: korn93 Type: Defect Subtype: Status: 7-Fix in Progress Substatus: Priority: 3-Medium Introduced In Release: solaris_nevada Introduced In Build: snv_72 Responsible Engineer: <User 1-5Q-5151> Keywords: opensolaris, oss-request, oss-sponsor === *Description* ============================================================ Category shell Sub-Category bourne Description This extract from the Qt 4.3/4.4 configure script does not work correctly: #!/bin/sh # Adds a new qmake variable to the cache # Usage: QMakeVar mode varname contents # where mode is one of: set, add, del QMakeVar() { case "$1" in set) eq="=" ;; add) eq="+=" ;; del) eq="-=" ;; *) echo >&2 "BUG: wrong command to QMakeVar: $1" ;; esac echo "$2" "$eq" "$3" } SYSTEM_VARIABLES="CC CXX CFLAGS CXXFLAGS LDFLAGS" for varname in $SYSTEM_VARIABLES; do cmd=`echo \ 'if [ -n "\$'${varname}'" ]; then QMakeVar set QMAKE_'${varname}' "\$'${varname}'" fi'` eval "$cmd" done Frequency Always Regression Solaris 10 Steps to Reproduce Run the above script. If none of the 'SYSTEM_VARIABLES' are set in the environment, nothing should be printed. Expected Result No output when CC etc are not set. Actual Result prints lines like QMAKE_CC = $CC In the Qt configure script, this causes malformed Makefiles to be generated, and the build of Qt fails. Error Message(s) None Test Case Workaround Use #!/bin/bash in the script Submitter wants to work on bug No Additional configuration information OS2008.05, running on Parallels on a Mac. I've read other reports of this problem (don't know what hardware). *** (#1 of 2): 2008-06-03 22:06:25 GMT+00:00 <User 1-F4SZV> David Korn responds: This is a ksh93 bug that has been there since the first release of ksh93. The bug happens with the sequence \$. inside ``. Note, that `` is obsolete and you should use $(...) instead. The next ksh93 patch will contain a fix for this. ["The next patch" refers to the upstream ksh93 release.] *** (#2 of 2): 2008-06-06 19:06:17 GMT+00:00 <User 1-5Q-1267> === *Public Comments* ======================================================== === *Workaround* ============================================================= === *Additional Details* ===================================================== Targeted Release: solaris_nevada Commit To Fix In Build: snv_106 Fixed In Build: Integrated In Build: Verified In Build: See Also: 6437624, 6619428 Duplicate of: Hooks: Hook1: Hook2: Hook3: Hook4: Hook5: <email address omitted> Hook6: <email address omitted> Program Management: Root Cause: Other - see Research Activity Fix Affects Documentation: No Fix Affects Localization: No === *History* ================================================================ Date Submitted: 2008-06-03 22:06:24 GMT+00:00 Submitted By: <User 1-F4SZV> Status Changed Date Updated Updated By 6-Fix Understood 2008-10-14 17:36:08 GMT+00:00 <User 1-5Q-5151> 7-Fix in Progress 2008-12-22 07:48:46 GMT+00:00 <User 1-5Q-5151> === *Service Request* ======================================================== Impact: Limited Functionality: Secondary Severity: 4 Product Name: solaris Product Release: solaris_nevada Product Build: snv_86 Operating System: solaris_nevada Hardware: x86 Submitted Date: 2008-06-03 22:06:25 GMT+00:00 === *Multiple Release (MR) Cluster* - 0 ======================================