bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"^.*$" not matching in sed with certain characters?


From: Linus Lüssing
Subject: "^.*$" not matching in sed with certain characters?
Date: Mon, 26 Sep 2011 23:19:27 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi,

I just wanted to use a regex in the following way:

$ ls tmp/*.zip | sed "s/^.*$/foo/"
tmp/Maniax Memori - L�%82�ktro Pöppe -- Jamendo - OGG Vorbis q7 - 2006.05.11 
[www.jamendo.com].zip

But I was a little startled by the output. If I remember
correctly, then "^.*$" should always match, shouldn't it? I would
have expected to get a "foo" back in this case.

grep seems to match fine though:
$ ls tmp/*.zip | grep "^.*$"
tmp/Maniax Memori - L�%82�ktro Pöppe -- Jamendo - OGG Vorbis q7 - 2006.05.11 
[www.jamendo.com].zip

So I guess (hope) that I'm not having some very basic regex/sed
misunderstanding :).

The file was retrieved via:
wget -q -P tmp/ --content-disposition 
"http://www.jamendo.com/get/album/id/album/archiverestricted/redirect/1873/?p2pnet=bittorrent&are=ogg3";

And I'm using sed version 4.2.1-7 on a Debian squeeze.

Cheers, Linus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]