pydelion.com

Passing bash variable to sed

If  you need to pass some variable from bash to sed use double quotes:

sed -i "s/$var/replace/g" "$file"

Easy.

Exit mobile version