Shell Sh Script: Running complex commands stored in variable
A command with pipe symabol or double quotes or single quote wtch may not work fine inside a shell script if it is stored in a variable.
In normal case, we would store the command in a variable name and run it using $ as
But when it does not work that way, try using eval
CMD=’ps -elf|grep vnc’