Although this seems like a simple task, the sed call is not substituting the value that I send for IP. Instead, it is replacing localhost with "${IP}".
substitute() {
export IP=$1
echo $IP
LC_ALL=C find . -type f -name '*.txt' -exec sed -i.bak 's/localhost/"${IP}"/g' {} \;
}
substitute 10.20.30.40
How do I achieve my purpose of substituting with a value send from an argument?