Strings In Depth8 / 17
Up next

Replace all matches

#!/usr/bin/env bash
s="a-b-c"
# doubling the slash replaces every match
echo "${s//-/_}"
What you're solving

${s//old/new} replaces every occurrence