Find and replace string in bash parameter

$ ./myscript my.site.com 

How to replace all points in the first parameter? Here is my current attempt, but it returns a bad substitution error.

 #!/bin/bash dbname=${$1//./_} echo $dbname 
+7
source share
1 answer
 dbname=${1//./_} 

Remove $ to 1 since $1 and ${1} match.

+12
source

All Articles