I'm trying to do the following: list files or directories containing certain characters then from the last slash in the path search for particular characters and replace them with a -
.
I built the following on regexpr but it does nothing with sed
:
find . -name "*[<>:\\|?]*" | while read -r; do mv "${REPLY}" \
"`echo ${REPLY} | sed "s/([^/]+$)*([<>:\\|?])/-/g"`"; done