I have an expect script and I would like to issue the following with exec. I have escaped the ', {, }, ", $0, ; all with no luck. The following works from command line.
$0 - Internal variable to awk
$host, $date - expect defined variables.
I get the following error - (With escape chars in place)
Code:
awk '{print substr($0,2,3) "," substr($0,5,3) "," substr ($0,8);}' ${host}.${date}.vlr > ${host}.${date}.vlr.csv
$host, $date - expect defined variables.
I get the following error - (With escape chars in place)
Code:
awk: syntax error near line 1
awk: bailing out near line 1
while executing
"exec awk '\{print substr(\$0,2,3) "," substr(\$0,5,3) "," substr (\$0,8)\;\}' ${host}.${date}.vlr > ${host}.${date}.vlr.csv"