$ ./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
dbname=${1//./_}
因为$1
和${1}
是相同的,所以在1之前删除$
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.