bug-grep
[Top][All Lists]
Advanced

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

Re: getting 'grepped' files from file list


From: Matthew Woehlke
Subject: Re: getting 'grepped' files from file list
Date: Tue, 16 Jun 2009 16:57:23 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.21) Gecko/20090320 Fedora/2.0.0.21-1.fc10 Thunderbird/2.0.0.21 Mnenhy/0.7.5.0

Bob Proulx wrote:
Uhm, well, hmm...  Once you start worring about whitespace in
filenames handling spaces but not handling newlines just doesn't feel
right.  Yes that will handle spaces but then not files with newlines
in them.  If effort is going to be put in there to handle one then the
other is not too far away using zero terminated strings.

Except... how many people have file names with '\n' in them? How many have files with ' ' in them? :-)

Given that most any GUI makes it easy to put ' ' in a file name (even without thinking about what problems it might cause), such files are fairly popular. Also it is natural to name a file e.g. 'My Christmas List.odt'. Not so much to put '\n' in a file name. (And, come to think of it, I bet most GUI's would have problems coping with file names containing '\n's.)

I understand the ivory tower approach, but really, what percentage of users have files with ' ' in their names, and how does it compare to the percentage of users with file names containing '\n'? I bet the former is pretty close to 100%, and the latter pretty close to 0.

Practically speaking, using 'xargs -d \\n' will work 99.9999% of the time.

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
Anyone who is capable of getting themselves made President should on no account be allowed to do the job. -- The Hitchhiker's Guide to the Galaxy (Douglas Adams)





reply via email to

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