TIL2: es sind noch deutlich mehr Zeichen gültig in URLs...
Nun...
tr "-" "_" | tr "." "_" | tr "~" "_" | tr ":" "_" | tr "/" "_" | tr "?" "_" | tr "#" "_" | tr "[" "_" | tr "]" "_" | tr "@" "_" | tr "!" "_" | tr "$" "_" | tr "&" "_" | tr "'" "_" | tr "(" "_" | tr ")" "_" | tr "*" "_" | tr "+" "_" | tr "," "_" | tr ";" "_" | tr "%" "_" | tr "=" "_"