[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#41262: Weird behavior with grep regex
From: |
Shlomi Fish |
Subject: |
bug#41262: Weird behavior with grep regex |
Date: |
Thu, 14 May 2020 21:52:11 +0300 |
Hi Loic!
On Thu, 14 May 2020 13:57:48 +0000
<address@hidden> wrote:
> Hi,
>
> I've reproduced a strange behaviour of grep command when a file name of a
> single letter is present in current directory .
>
> $ echo a | grep [a-z]
> a
> $ touch t
> $ echo a | grep [a-z]
> $ rm t
> $ echo a | grep [a-z]
> a
> $
>
This is standard Unix shell ( sh / ksh / bash ) globbing behaviour:
https://en.wikipedia.org/wiki/Glob_%28programming%29
Quoting works:
```
[shlomif@localhost ~]$ cd tmp
[shlomif@localhost tmp]$ touch t
[shlomif@localhost tmp]$ echo a | grep [a-z]
[shlomif@localhost tmp]$ echo a | grep '[a-z]'
a
[shlomif@localhost tmp]$ echo a | grep "[a-z]"
a
[shlomif@localhost tmp]$
```
Also see https://perl-begin.org/topics/security/code-markup-injection/ .
>
> Any idea ?
>
> Regards
>
> _________________________________________________________________________________________________________________________
>
> Ce message et ses pieces jointes peuvent contenir des informations
> confidentielles ou privilegiees et ne doivent donc pas etre diffuses,
> exploites ou copies sans autorisation. Si vous avez recu ce message par
> erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les
> pieces jointes. Les messages electroniques etant susceptibles d'alteration,
> Orange decline toute responsabilite si ce message a ete altere, deforme ou
> falsifie. Merci.
>
> This message and its attachments may contain confidential or privileged
> information that may be protected by law; they should not be distributed,
> used or copied without authorisation. If you have received this email in
> error, please notify the sender and delete this message and its attachments.
> As emails may be altered, Orange is not liable for messages that have been
> modified, changed or falsified. Thank you.
>
Ahem :(
--
Shlomi Fish https://www.shlomifish.org/
https://www.shlomifish.org/humour/Summerschool-at-the-NSA/
Knuth is not God! Typing “God” into Google and pressing “I’m Feeling Lucky”
will not lead you to his homepage.
— https://www.shlomifish.org/humour/bits/facts/Knuth/
Please reply to list if it's a mailing list post - https://shlom.in/reply .