The problem
I'm trying to create a kickstart file automatically, and the tool I'm using to parse it requires the kickstart to be supplied as a string in single quotes.
Most of it is fine, except the postinstall script which uses AWK, hence single quotes within single quotes.
I've looked at some of the other posts and tried escaping the strings, to no avail.
I've clearly mis-understood some fundamental principal of escaping.
The code
DATA='
GATEWAY=$(localcli network ip route ipv4 list | grep default | awk \'{print $3}\')
'
echo ${DATA}
The desired output
This is the literal output string I'd like to see.
GATEWAY=$(localcli network ip route ipv4 list | grep default | awk '{print $3}')