This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

B20: bug in bash string substitution, ${var%%/*} eats last character


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".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]