How can I remove missing files with spaces in svn? How can I remove missing files with spaces in svn? bash bash

How can I remove missing files with spaces in svn?


svn status | grep '^\!' | cut -c8- | while read f; do svn rm "$f"; done


You could 0 escape and use the -0 flag to xargs.

svn st | awk '/^!/ { sub("^! +", ""); printf "%s\0", $0 }' | xargs -0 svn rm

This has another advantage in that files with quotes or other special characters will not screw up the xargs command line either.


With GNU awk, I can do:

svn stat | awk -v FIELDWIDTHS="1 6 1000 1" -v ORS=$'\0' '$1 == "!" { print $3 }' | xargs -0 svn rm