Search This Blog

Monday, November 8, 2010

How to remove error in case there is a space in path name

find ./ -name "entries" -print0 | xargs -0 sed -i 's/svnserver\:8443/nnn.nnn.nnn.nnn\:8443/g'

-print0 for find
True; print the full file name on the standard output, followed by a null character (instead of the newline character that '-print' uses). This allows file names that contain newlines or other types of white space to be correctly interpreted by programs that process the find output. This option corresponds to the '-0' option of xargs.

--null, -0 for xargs
Input items are terminated by a null character instead of by whitespace, and the quotes and backslash are not special (every character is taken literally). Disables the end of file string, which is treated like any other argument. Useful when input items might contain white space, quote marks, or backslashes. The GNU find -print0 option produces input suitable for this mode.

No comments:

Post a Comment

Blog Archive