Crazy Syntax

Hello All,

was looking at a script wrote by someone and when I try and run it in ksh it gives me an error. Could ksh version be a problem or is there something wrong that I'm missing, when I run it from the command line it works. Thanks!

results=`sudo -u admin ssh loginadmin@host.mgmt\$zone.check "onehost list | grep \$server; echo; onevm list | grep \$server | awk '{printf \\"%-11s%-8s%-8s%-8s%-8s\\n\\", \$2, \$1, \$3, \$5, \$4}' | sort -r"`

Error:

awk: line 1: syntax error at or near ,

Also unrelated question, if a host has a login text and you don't want it to show how can you hide it in a ksh script?

Processing double quotes inside single-quotes inside double-quotes inside an obsolete command substitution is always fun...

What shell (including version) was "someone" who wrote this script using? What operating system (including release number) was "someone" who wrote this script using? What operating system are you using? What version of ksh are you using?

What output do you get from the command:

ksh -xv
results=$(sudo -u admin ssh loginadmin@host.mgmt\$zone.check "one host list | grep \$server; echo; onevm list | grep \$server")
printf 'results=XXX"%s"XXX\n' "$results"