#!/usr/bin/env bash

toDots='\,;:|+@#$%^&*~'
toUnderscores='}{]['"'"'="()`!'

runOrDebug() {
  if (( debug )); then
    printf '%s\n' "${*@Q}"
  else
    "$@"
  fi
}

renameFiles() {
  local name subDots subBoth

  for name; do
    subDots=${name//["$toDots"]/.}
    subBoth=${subDots//["$toUnderscores"]/_}

    if [[ $subBoth != "$name" ]]; then
      runOrDebug mv -- "$name" "$subBoth"
    fi
  done
}

debug=1 renameFiles '[/a],/;[p:r|o\b+lem@a#t$i%c]/@(%$^!/(e^n&t*ry)~='