[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with pattern replacing when STRING is an expandable char
From: |
Heinz-Ado Arnolds |
Subject: |
Problem with pattern replacing when STRING is an expandable char |
Date: |
Wed, 12 Dec 2007 15:47:33 +0100 |
User-agent: |
Thunderbird 1.5.0.13 (X11/20070809) |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I/tmp/S/bash-3.2 -I/tmp/S/bash-3.2/include
-I/tmp/S/bash-3.2/lib -g -O2
uname output: Linux ***** 2.6.23.1 #1 SMP PREEMPT Tue Oct 16 16:47:14 CEST
2007 i686 GNU/Linux
Machine Type: i686-pc-linux-gnu
Bash Version: 3.2
Patch Level: 25
Release Status: release
Description:
Pattern replacing doesn't work like documented with special
characters "*" and "?" as replacment strings
Repeat-By:
a=111.1
echo ${a//[0-9]/x}
correctly gives "xxx.x", but
echo ${a//[0-9]/*}
gives a listing of files in current directory. Seems that the "*"
is expanded before replacing the pattern.
It workes the right way at least up to bash-3.1.17(1)-release
But if you set
a=111
it doesn't even work in 3.1.17 right.
Kind regards,
H.-A. Arnolds
--
________________________________________________________________________
Dipl.-Ing. Heinz-Ado Arnolds
MPI fuer Astrophysik
Karl-Schwarzschild-Strasse 1
D-85748 Garching
Phone: +49/89/30000-2217
FAX : +49/89/30000-2388
email: arnolds[at]MPA-Garching.MPG.DE
________________________________________________________________________
- Problem with pattern replacing when STRING is an expandable char,
Heinz-Ado Arnolds <=