bash remplacer la sous-chaîne
echo [string] | sed "s/[original]/[target]/g"
Curious Cobra
echo [string] | sed "s/[original]/[target]/g"
string="abc"
final=${string//[a]/b}
echo $final
#!/bin/bash
firstString="I love Suzi and Marry"
secondString="Sara"
echo "${firstString/Suzi/$secondString}"
# prints 'I love Sara and Marry'