Following on from my previous question:
I arrived at the following command which replaces any filenames in these files with just the basename:
grep -o -h -E '[A-Za-z0-9:./_-]+\.(png|jpg|gif|tif|css)' |\ sed "s:[a-zA-z0-9]*/::" `find . -name '*.css' -or -name '*.js'`
How do I save the output of this command back to the source file for each file processed?