This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
B20: bug in bash string substitution, ${var%%/*} eats last character
- To: <gnu-win32 at cygnus dot com>
- Subject: B20: bug in bash string substitution, ${var%%/*} eats last character
- From: "Pascal Lemaitre" <pascal dot lemaitre at capgemini dot fr>
- Date: Wed, 23 Dec 1998 16:54:43 +0100
The following script does not work correctly as a file, whereas it does in
interactive mode. Here is what happens :
----------------------------------------------------------------------------
--
poste163:~> exemple.sh
Gdm/Noy -- Gd
Gdm/Noy -- Gd
Longueur/largeur -- Longueu
poste163:~>. exemple.sh
Gdm/Noy -- Gdm
Gdm/Noy -- Gdm
Longueur/largeur -- Longueur
----------------------------------------------------------------------------
--
The script text is:
----------------------------------------------------------------------------
--
for tst in Gdm/Noy "Gdm/Noy" Longueur/largeur
do
echo $tst '--' ${tst%%/*}
done
----------------------------------------------------------------------------
--
PS: it is not easy to find if a similar bug has already been reported.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".