如何使用sed
来替换例如这个表达式:
connection = sqllite///[email protected]
用这种表达
connection = mysql://keystoneUser:[email protected]/keystone
答案1
例如,您可以使用:
echo "connection = sqllite///[email protected]" | \
sed "s/sqllite\/\/\/[email protected]/mysql:\/\/keystoneUser:[email protected]\/keystone/"