On Sat, 9 Aug 2003, Vincent Zee wrote:
>I have 5000 directory names with %20 in its names and would like to
>replace them with 1 space.
>I only want to change the directory names and leave its contents
>untouched. Also I need to do this recursively (directories in
>I checked google but the answers I found were for files in directories.

Completely untested.  Use at your own risk.

Replace "TOPDIR" with the name of the top of the directory tree.

        find TOPDIR -depth -type d -name '*%20*' -print \
        | while read old
                new="`echo \"${old}\" | sed -e 's/%20/ /g'`"
                ( set -x; mv "${old}" "${new}" )

Steve Coile
[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to