View Single Post
Old 04-30-2020, 12:03 PM   #88
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
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

Last edited by NiLuJe; 04-30-2020 at 12:08 PM.
NiLuJe is offline   Reply With Quote