This is the mail archive of the cygwin-talk mailing list for the cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: find, xargs and spaces


Fergus wrote:

> fails.) (There are probably alternative ways of attacking this specific
> problem that avoid the -print0 .. -0 .. but I would be interested in a
> general solution.)

In the general case, you just have to ensure that whatever's in front of
xargs in the pipeline outputs null delimited records, and if it doesn't
insert something in the pipeline that will, such as perl -pe
's,\n,\0,'.  Of course, this means that you can't process files that
contain newlines in their names, but if the previous utility in the
pipeline can't natively emit null-delimited output then you've already
lost that battle and it's impossible to recover.

In this specific case however, just use grep -Z.

> I know this is not Cygwin-specific but if there is a simple answer I
> would really appreciate the help.

Of course it's not.  Don't you think the fileutils list would be a
better place?

Brian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]