[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Fwd: Re: Rename directory]
From: |
Schrum, Allan (Allan) |
Subject: |
RE: [Fwd: Re: Rename directory] |
Date: |
Tue, 13 Dec 2005 09:53:14 -0500 |
Of course, the original reason for doing "xargs" was that "find -exec" was
slow. Since "find" outputs the filenames as strings, and "sed" is a nice
string editor, an equivalent method might be:
find dir -print | sed -e 's/^/"/' -e 's/$/"/' | xargs
This doesn't use GNU extensions.
-Allan
-----Original Message-----
From: Matt Doar [mailto:address@hidden
Sent: Monday, December 12, 2005 4:50 PM
To: Larry Jones
Cc: address@hidden; Todd Denniston
Subject: RE: [Fwd: Re: Rename directory]
Good point. The specification formerly known as POSIX suggests a
workaround.
"If xargs is used to bundle output of commands like find dir -print or
ls into commands to be executed, unexpected results are likely if any
filenames contain any <blank>s or <newline>s. This can be fixed by using
find to call a script that converts each file found into a quoted string
that is then piped to xargs."
http://www.unix.org/single_unix_specification/
~Matt
-----Original Message-----
From: Larry Jones [mailto:address@hidden
Sent: Monday, December 12, 2005 1:37 PM
To: Matt Doar
Cc: Todd Denniston; Jim Hyslop; address@hidden
Subject: Re: [Fwd: Re: Rename directory]
Matt Doar writes:
>
> find and xargs actually works fine with files and directories with
> spaces in them.
> You just have to use find -print0 | xargs -0
Those are non-standard GNU extensions.
-Larry Jones
It's hard to be religious when certain people are never
incinerated by bolts of lightning. -- Calvin
_______________________________________________
Info-cvs mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/info-cvs