modified sed to follow symlinks