delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/04/13/10:46:23

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <C9A8E1D07093D111B76A0000F8C9918A0326669B@zrtpd003.us.nortel.com>
From: "Christopher Jones" <cbjones AT nortelnetworks DOT com>
To: jase AT deadbeets DOT com, cygwin AT sourceware DOT cygnus DOT com
Subject: RE: bash expansion question
Date: Thu, 13 Apr 2000 09:38:05 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
X-Orig: <cbjones AT americasm01 DOT nt DOT com>

------_=_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?&nbsp; Is /bin/sh =
actually 'bash' or is it the default 'ash' shell?&nbsp; 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>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=3D2>&gt; From: Jason Dufair [<A =
HREF=3D"mailto:jase AT deadbeets DOT com">mailto:jase AT deadbeets DOT com</A>]</FONT>=

<BR><FONT SIZE=3D2>&gt; Sent: Wednesday, April 12, 2000 10:29 PM</FONT>
<BR><FONT SIZE=3D2>&gt; To: cygwin AT sourceware DOT cygnus DOT com</FONT>
<BR><FONT SIZE=3D2>&gt; Subject: bash expansion question</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Hello -</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; I have cygwin b20 running on WinNT SP6</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; at the command line I get the following:</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; $ foo=3Dbar/baz</FONT>
<BR><FONT SIZE=3D2>&gt; $ echo ${foo%%/*}</FONT>
<BR><FONT SIZE=3D2>&gt; foo</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; However, if I have the following in a =
script:</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; foo=3Dbar/baz</FONT>
<BR><FONT SIZE=3D2>&gt; echo ${foo%%/*}</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; and then run it, I get</FONT>
<BR><FONT SIZE=3D2>&gt; $ test.sh</FONT>
<BR><FONT SIZE=3D2>&gt; ba</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; It seems to be dropping one too many =
characters.&nbsp; It seems I've either</FONT>
<BR><FONT SIZE=3D2>&gt; found an expansion bug or I'm misunderstanding =
something.&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; Testing this</FONT>
<BR><FONT SIZE=3D2>&gt; on my linux box (bash 1.14.7), it works as =
expected.&nbsp; Can someone</FONT>
<BR><FONT SIZE=3D2>&gt; clarify this for me?&nbsp; Thanks a lot.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; -- </FONT>
<BR><FONT SIZE=3D2>&gt; Jason Dufair - jase AT deadbeets DOT com - PGP key on =
keyservers</FONT>
<BR><FONT SIZE=3D2>&gt; &quot;So many ways to understand</FONT>
<BR><FONT SIZE=3D2>&gt; One for every woman and man</FONT>
<BR><FONT SIZE=3D2>&gt; Been that way since the world began&quot; - =
Bruce Cockburn</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; --</FONT>
<BR><FONT SIZE=3D2>&gt; Want to unsubscribe from this list?</FONT>
<BR><FONT SIZE=3D2>&gt; Send a message to =
cygwin-unsubscribe AT sourceware DOT cygnus DOT com</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01BFA54D.7FA0176A--

- Raw text -


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