Need help with sed to fix migrated web site links
I'm moving my web files from one host to another, and have backed up my directory called WEB into my user downloads folder. The site is dead simple, mostly links within the site, pages primarily text with some links to my photos posted on flickr, and a few outside links. I want to avoid opening/replacing/saving a hundred or more files to fix the links from "http://www.old_domain_name/user/my_username" to "http://my_new_domain_name"
A friend suggested the following scripts to do this
mkdir fix_urls
cd fix_urls
cp -r <wherever>/WEB .
cd WEB
xargs -0 egrep -i old_domain_name $(find * -name "*.html" -print0) > ../to_fix
cd ..
less to_fix
to see what needs changing, but after I've created and moved to WEB, the xargs command results in a zero kb file called to_fix appearing in WEB, and nothing else happens....and the prompt in terminal (myusername$) doesn't reappear.
I tried his part II anyway:
mkdir new_web
while read filename; do
sed 's/\/www.old_domain_name/user/my_username/\/my_new_domain_name/' < WEB/$filename > new_web/$filename
done
diff -r WEB new_web > what_i_did
less what_i_did
and after the 'done', I get again....nothing. No new cursor gray rectangle, no new prompt, haven't even gotten to the last bit of diff to review the changes.
Any tips on what fundamental bone-headed thing I'm doing wrong?