Replace a variable in a file programmatically (sed)

?
S
Bash

Programatically replace variables in files.

1# This will replace IMAGE_URL
2sed -i -e 's@IMAGE_URL@'"$REGISTRY/hello-webapp:v1"'@' deployment.yaml
3
4# Simpler example
5cat deploysed -i -e 's@IMAGE_URL@'xxx'@' deployment.yaml
6
7# Find and Replace
8sed -i -e 's/Hello World!/Hello Hacker News!!!/' app.py
9

Created on 7/30/2018