This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
RE: bash $substitution in 2.05b.0-9
- From: "Hannu E K Nevalainen (garbage mail)" <garbage_collector at telia dot com>
- To: "ML CygWIN" <cygwin at cygwin dot com>
- Date: Tue, 5 Aug 2003 22:06:53 +0200
- Subject: RE: bash $substitution in 2.05b.0-9
> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.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/