I have many of the input lines as seen below, where I would like to end up with an output similar to this
host tsclient010.tsclient {
option host-name "tsclient010.tsclient";
hardware ethernet 00E0C56BF96D;
fixed-address 192.168.246.10;
}
fore ach of the inputs. However I run into the problem that the static content contains {}.
echo "192.168.246.10 00E0C56BF96D tsclient010.tsclient" | awk '{print
host $3 {
option host-name "$3";
hardware ethernet $2;
fixed-address $1;
}
}'
Output:
awk: cmd. line:2: host $3 {
awk: cmd. line:2: ^ syntax error
I have tried to escape it by '\{', but doesn't work.
Question
Does anyone know how to escape the needed chars?