Whats wrong here? The echo shows the correct syntax. Please help, thank you.
#!/bin/ksh
CMD="su - db2i72 -c 'db2 list utilities'" # or this
CMD="su - db2i72 -c \'db2 list utilities\'" # or this
CMD="su - db2i72 -c \"db2 list utilities\"" # or this, always the same...
echo $CMD
$CMD
root@server:~ # ./test
su - db2i72 -c 'db2 list utilities'
Unmatched '.