Mail Archives: cygwin/2000/04/13/10:46:23
------_=_NextPart_001_01BFA54D.7FA0176A
Content-Type: text/plain;
charset="iso-8859-1"
Is your script calling /bin/sh? Is /bin/sh actually 'bash' or is it the
default 'ash' shell? Using b20.1 I get 'bar' both times with script or
command line.
Brian
> -----Original Message-----
> From: Jason Dufair [mailto:jase AT deadbeets DOT com]
> Sent: Wednesday, April 12, 2000 10:29 PM
> To: cygwin AT sourceware DOT cygnus DOT com
> Subject: bash expansion question
>
>
> Hello -
>
> I have cygwin b20 running on WinNT SP6
>
> at the command line I get the following:
>
> $ foo=bar/baz
> $ echo ${foo%%/*}
> foo
>
> However, if I have the following in a script:
>
> foo=bar/baz
> echo ${foo%%/*}
>
> and then run it, I get
> $ test.sh
> ba
>
> It seems to be dropping one too many characters. It seems I've either
> found an expansion bug or I'm misunderstanding something.
> Testing this
> on my linux box (bash 1.14.7), it works as expected. Can someone
> clarify this for me? Thanks a lot.
>
> --
> Jason Dufair - jase AT deadbeets DOT com - PGP key on keyservers
> "So many ways to understand
> One for every woman and man
> Been that way since the world began" - Bruce Cockburn
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
>
------_=_NextPart_001_01BFA54D.7FA0176A
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2651.65">
<TITLE>RE: bash expansion question</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>Is your script calling /bin/sh? Is /bin/sh =
actually 'bash' or is it the default 'ash' shell? Using b20.1 I =
get 'bar' both times with script or command line.</FONT></P>
<P><FONT SIZE=3D2>Brian</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>> -----Original Message-----</FONT>
<BR><FONT SIZE=3D2>> From: Jason Dufair [<A =
HREF=3D"mailto:jase AT deadbeets DOT com">mailto:jase AT deadbeets DOT com</A>]</FONT>=
<BR><FONT SIZE=3D2>> Sent: Wednesday, April 12, 2000 10:29 PM</FONT>
<BR><FONT SIZE=3D2>> To: cygwin AT sourceware DOT cygnus DOT com</FONT>
<BR><FONT SIZE=3D2>> Subject: bash expansion question</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> Hello -</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> I have cygwin b20 running on WinNT SP6</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> at the command line I get the following:</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> $ foo=3Dbar/baz</FONT>
<BR><FONT SIZE=3D2>> $ echo ${foo%%/*}</FONT>
<BR><FONT SIZE=3D2>> foo</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> However, if I have the following in a =
script:</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> foo=3Dbar/baz</FONT>
<BR><FONT SIZE=3D2>> echo ${foo%%/*}</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> and then run it, I get</FONT>
<BR><FONT SIZE=3D2>> $ test.sh</FONT>
<BR><FONT SIZE=3D2>> ba</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> It seems to be dropping one too many =
characters. It seems I've either</FONT>
<BR><FONT SIZE=3D2>> found an expansion bug or I'm misunderstanding =
something. </FONT>
<BR><FONT SIZE=3D2>> Testing this</FONT>
<BR><FONT SIZE=3D2>> on my linux box (bash 1.14.7), it works as =
expected. Can someone</FONT>
<BR><FONT SIZE=3D2>> clarify this for me? Thanks a lot.</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> -- </FONT>
<BR><FONT SIZE=3D2>> Jason Dufair - jase AT deadbeets DOT com - PGP key on =
keyservers</FONT>
<BR><FONT SIZE=3D2>> "So many ways to understand</FONT>
<BR><FONT SIZE=3D2>> One for every woman and man</FONT>
<BR><FONT SIZE=3D2>> Been that way since the world began" - =
Bruce Cockburn</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> --</FONT>
<BR><FONT SIZE=3D2>> Want to unsubscribe from this list?</FONT>
<BR><FONT SIZE=3D2>> Send a message to =
cygwin-unsubscribe AT sourceware DOT cygnus DOT com</FONT>
<BR><FONT SIZE=3D2>> </FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01BFA54D.7FA0176A--
- Raw text -