Avoid replacing spaces when renaming files – askubuntu.com

I'm trying to rename files like this: for file in *; do mv -i "$file" "$(echo "$file" | sed -e 's/[^A-Za-z0-9._-]/_/g')"; done But the sed command replaces all spaces with _. How can I edit the sed ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "Avoid replacing spaces when renaming files – askubuntu.com"