Don't put a full pipeline in a variable, that won't work.
Code:
~ $ cmdline="ls -lash /var/tmp | sort -u"
~ $ $cmdline
ls: |: No such file or directory
ls: sort: No such file or directory
Quoting means what it says on the tiin: it'll quote metacharacters, and pass them as *arguments*. Word-splitting may also be an issue in some cases.
i.e., this actually ends up running something along the lines of
ls -lash /var/tmp "|" sort -u