Subject: Re: Fwd: Subject: [ksh93-integration-discuss] CR 6710205 P3
shell/korn93 problem with quoting in script
--------
> *Synopsis*: problem with quoting in script
>
> CR 6710205 changed on Jun 5 2008 by <User 1-6Y4MMS>
>
> === Field ============ === New Value ============= === Old Value
> =============
>
> Category shell opensolaris
> SubCategory korn93 triage-queue
> ====================== ===========================
> ===========================
>
>
> *Change Request ID*: 6710205
>
> *Synopsis*: problem with quoting in script
>
> Product: solaris
> Category: shell
> Subcategory: korn93
> Type: Defect
> Subtype:
> Status: 1-Dispatched
> Substatus:
> Priority: 3-Medium
> Introduced In Release:
> Introduced In Build:
> Responsible Engineer:
> Keywords: opensolaris
>
> === *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 1): 2008-06-03 22:06:25 GMT+00:00 <User 1-F4SZV>
>
>
> === *Workaround*
> =============================================================
>
> === *Additional Details*
> =====================================================
> Targeted Release:
> Commit To Fix In Build:
> Fixed In Build:
> Integrated In Build:
> Verified In Build:
> See Also:
> Duplicate of:
> Hooks:
> Hook1:
> Hook2:
> Hook3:
> Hook4:
> Hook5:
> Hook6: <email address omitted>
> Program Management:
> Root Cause:
> 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
>
>
> === *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
> ======================================
>
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.
David Korn
dgk at research.att.com