| delorie.com/archives/browse.cgi | search |
| From: | "Tim 'Zastai' Van Holder" <zastai AT hotmail DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| References: | <D1D61633AF7 AT HRZ1 DOT hrz DOT tu-darmstadt DOT de> |
| Subject: | Re: bash regexp question |
| Lines: | 41 |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-Newsreader: | Microsoft Outlook Express 5.50.4133.2400 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V5.50.4133.2400 |
| Message-ID: | <Apep5.27953$Ee.206232@afrodite.telenet-ops.be> |
| Date: | Thu, 24 Aug 2000 19:09:20 GMT |
| NNTP-Posting-Host: | 213.224.92.242 |
| X-Trace: | afrodite.telenet-ops.be 967144160 213.224.92.242 (Thu, 24 Aug 2000 21:09:20 MET DST) |
| NNTP-Posting-Date: | Thu, 24 Aug 2000 21:09:20 MET DST |
| Organization: | Pandora - Met vlotte tred op Internet |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
"Juan Manuel Guerrero" <ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De> wrote in message
news:D1D61633AF7 AT HRZ1 DOT hrz DOT tu-darmstadt DOT de...
> Please look at the following code:
> case ${PWD-`pwd`} in
> /*)
> echo POSIX;;
> ?:[/\\]*)
> echo MS-DOS;;
> esac
>
> I would expect that the code prints: MS-DOS.
> The fact is that it does nothing.
> If I replace the regular expresion: [/\\] by [\\/]
> the code works.
> Is this a bash bug or some Posix feature completely
> unknow to me. I am using stock bash203.
>
> I have found *similar* code in conf.sh. This file is part
> of rcs5713s.zip and of course I can not configure the
> package due to this "misfeature" or bug in bash.
>
I also noticed this when patching autoconf 2.14a(1) and was equally
surprised; but I just accpeted it and moved on. I haven't tested if
bash does the same on a *nix system, though; nor have I checked to
see whether bash 1.14.7 handles it the same way.
In any case, if my patched autoconf ever gets released, it will use
the working version :-)
Oh, and it's a shell wildcard, not a regexp (hence '/*' and not '/.*').
Tim Van Holder
(1): Now defunct; autoconf 2.49a has appeared on alpha.gnu.org, so I'll
be patching that shortly. Hopefully, I may get at least some of the
patches submitted before release.
--
Hi, I'm a signature virus. plz set me as your signature and help me spread
:)
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |