Reputation: 14997
$ ./myscript my.site.com
How do I replace all dots in the first parameter? Here's my current try but it's returning a bad substition error.
#!/bin/bash
dbname=${$1//./_}
echo $dbname
Upvotes: 7
Views: 1520
Reputation: 63688
dbname=${1//./_}
Remove $
before 1 since $1
and ${1}
are the same.
Upvotes: 12