Stupid Find

This command should work, imho:

$file = ~/personal/private/.htaccess;
find ~/ -name .htaccess -type f -exec diff $file {}
              || ( echo 'Replacing: ' {} && rm {} && ln -s $file {} );

It should hunt down all the copies of my .htaccess files that are only there to password protect a directory and make them symlinks to an authoritative version.

There are many ways to accomplish the task and ⟰ is apparently not one of them. ☺

Leave a Reply

Your email address will not be published. Required fields are marked *