Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 2014 22:05:18 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269352 - head/usr.sbin/bsdconfig/share
Message-ID:  <201407312205.s6VM5Ia8038682@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Thu Jul 31 22:05:18 2014
New Revision: 269352
URL: http://svnweb.freebsd.org/changeset/base/269352

Log:
  Fix a syntax error when running under bash(1) for portability.

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/dialog.subr	Thu Jul 31 22:00:36 2014	(r269351)
+++ head/usr.sbin/bsdconfig/share/dialog.subr	Thu Jul 31 22:05:18 2014	(r269352)
@@ -2099,9 +2099,13 @@ f_dialog_init()
 	#
 	# Process stored command-line arguments
 	#
+	# NB: Using backticks instead of $(...) for portability since Linux
+	#     bash(1) balks at the right parentheses encountered in the case-
+	#     statement (incorrectly interpreting it as the close of $(...)).
+	#
 	f_dprintf "f_dialog_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \
 	          "$ARGV" "$GETOPTS_STDARGS"
-	SECURE=$( set -- $ARGV
+	SECURE=`set -- $ARGV
 		while getopts \
 			"$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \
 		flag > /dev/null; do
@@ -2109,8 +2113,8 @@ f_dialog_init()
 			S) echo 1 ;;
 			esac
 		done
-	)
-	USE_XDIALOG=$( set -- $ARGV
+	` # END-BACKTICK
+	USE_XDIALOG=`set -- $ARGV
 		while getopts \
 			"$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \
 		flag > /dev/null; do
@@ -2118,7 +2122,7 @@ f_dialog_init()
 			S|X) echo 1 ;;
 			esac
 		done
-	)
+	` # END-BACKTICK
 	f_dprintf "f_dialog_init: SECURE=[%s] USE_XDIALOG=[%s]" \
 	          "$SECURE" "$USE_XDIALOG"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407312205.s6VM5Ia8038682>