consider there a directory called hello world
in the current directory. Yes the directory has a space in it. For sake of example lets say it has a file called f1.txt.
ls 'hello world'
will print
f1.txt
but
a="ls 'hello world'"
$a
say
ls: cannot access ''\''hello': No such file or directory
ls: cannot access 'world'\''': No such file or directory
So the question is how to make ls list the directory hello world
.
Basically how to this
a="1 2"
b="ls $a"
$b
to actually list the contents of the folderhello world
PS: I don't want to do
a="1 2"
ls $a
I want to store it and only then run it