From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ralph Alvy Subject: Re: Syntax error: Bad substitution Date: Sat, 28 Oct 2006 18:17:43 -0700 Message-ID: References: <20061028225657.GA18195@bluesong.van.maves.ca> <20061029004107.GA8494@bluesong.van.maves.ca> Mime-Version: 1.0 Content-Transfer-Encoding: 7Bit Return-path: Sender: linux-msdos-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" To: linux-msdos@vger.kernel.org Matthew Clarke wrote: > Sat, Oct 28, 2006 at 05:14:55PM -0700, Ralph Alvy may have written: > >> Matthew Clarke wrote: >> >> > Fri, Oct 27, 2006 at 08:32:32PM -0700, Ralph Alvy may have written: >> > >> >> I'm getting the following error when running dosemu 1.2.2 under a >> >> newly installed Kubuntu 6.10: >> >> >> >> ./xdosemu: 86: Syntax error: Bad substitution >> >> >> >> What might be going on here? > > [ snip ] > >> 84 -install) >> 85 INSTALL=1 >> 86 if [ -n "$2" -a "${2:0:1}" != "-" ]; then >> 87 PROPRIETARY=$2 > > Line 1 of the script says "#! /bin/sh", which implies that the code in the > script is written in the syntax understood by the Bourne shell. However, > ${2:0:1} is syntax for the GNU Bourne-again shell (AKA bash), not the > Bourne shell. My guess is that your other distributions make /bin/sh a > symbolic link to /bin/bash, but that Kubuntu 6.10 points /bin/sh to some > other shell that understands Bourne shell syntax but not bash syntax, so > the other systems hide this error in the script but Kubuntu 6.10 doesn't. > > If bash is installed as /bin/bash, you can change the first line of the > script to > > #! /bin/bash > > to avoid the problem. > > Matt. Thanks, Matt. This solved it nicely.