I am trying to create a script that replaces everything with a ".". occurrences in the file name using "_". For example, when I try to replace all "characters", I use this:
rename 'y/ /_/' '{}' file
This works fine, but when I try to do it with "." The character also adds an extension:
rename 'y/./_/' '{}' file
How can I rename a file without changing the extension (if any)?
source share