delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/08/05/16:08:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Hannu E K Nevalainen (garbage mail)" <garbage_collector AT telia DOT com>
To: "ML CygWIN" <cygwin AT cygwin DOT com>
Subject: RE: bash $substitution in 2.05b.0-9
Date: Tue, 5 Aug 2003 22:06:53 +0200
Message-ID: <NGBBLLIAMFLGJEOAJCCEOEJDDCAA.garbage_collector@telia.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
In-Reply-To: <3F300570.7020209@pusspaws.net>
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200

> From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]On Behalf
> Of David Selby
> Sent: Tuesday, August 05, 2003 9:29 PM
> To: Cygwin list
> Subject: bash $substitution in 2.05b.0-9
>
>
> I have hit a problem with bash ... as a sample program I have ...
>
> #!/bin/sh
>
> test="123456789"
> temp=${test:1:2}
> echo $temp
>
> If I execute the above in debian woody bash 2.05a.0(1) I get
> 23
>
> OK so far.
>
> I have cgywin on 98SE, with bash 2.05b.0-9. When I run the
> above I get ...
>
> :syntax error:bad substitution
>
> for the ... temp=${test:1:2} ... line
>
> Woody + cgywin are almost identical versions of bash, Apparently the
> above statement is valid in any bash >2.0, Any idea why the
> problem ?
>
> Dave


$ uname -a
CYGWIN_NT-5.0 P450 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 unknown unknown
Cygwin
$ test="123456789"
$ temp=${test:1:2}
$ echo $temp
23
$

$ uname -a
CYGWIN_98-4.10 P450 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 unknown unknown
Cygwin
$ test="123456789"
$ temp=${test:1:2}
$ echo $temp
23
$ bash --version
GNU bash, version 2.05b.0(9)-release (i686-pc-cygwin)
Copyright (C) 2002 Free Software Foundation, Inc.

Makes no difference to have it in a script.

--
NOTE: The very same cygwin-files gets executed - same install used for both
W2K and W98SE on a dual boot machine.

To achieve this I have:

	$ tail -8 ~/.profile

	if [ -f /cygwin.mnt ]
	then
	  # this one contains last mounted volumes
	  source /cygwin.mnt
	fi

	$ cat ~/.bash_logout
	# ~/.bash_logout - by Hannu E K Nevalainen
	cd /
	mount -m >cygwin.mnt

	$

Initial install was using W98SE, I've run updates from W2K...
(Hrm... should I? It seems to have worked ;-)


/Hannu E K Nevalainen, B.Sc. EE Microcomputer systems - 59°14'N, 17°12'E
--END OF MESSAGE--


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019