I have a Bash script doing something. It contains a single static statement CHANGE_ME
. What I want is to replace CHANGE_ME
with the output from variable i.e.:
If $VAR is set to 192.168.x.x then replace CHANGE_ME
with some-text
How can I do this?
The script has variable:
#!/bin/bash
NODE_NAME="CHANGE_ME"
...
In another start-up script I want to replace CHANGE_ME
depends of the returned VAR value:
if [[ "$SOMETHING" == "true" ]]; then
NETWORK=$(curl http://169.254.169.254/latest/meta-data/local-ipv4)
and if NETWORK returns for instance 192.168.x.y then replace CHANGE_ME with X else if NETWORK returns 172.16 then replace CHANGE_ME with Y
some-text
is. – Nasir Riley Jan 04 '21 at 16:41CHANGE_ME
? In the "bash script that does something"? – AdminBee Jan 06 '21 at 11:35