Re: Syntax error: Bad substitution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
-- 
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
				-- Richard P. Feynman
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Console]     [Linux Audio]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Camping]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Samba]     [Linux Media]     [Fedora Users]

  Powered by Linux