Quote:
Originally Posted by Linux.tar.gz
Delay the ls command in a detached process.
|
puts the result of ls into a pseudo variable (I'm not using the real terminology here cause I don't know it, but I know what happens)
So you can use it with a command
Code:
echo $(which uname)
Or put it as a value into a 'real' variable.
Code:
my_uname=$(which uname)
echo $my_uname
Which you're not doing.
So it just tries to run whatever ls spits out (until a line break or some argument delimiter) as a command.
So maybe one of the files in the directory you're running your command is called "Inner Tube In Pool" and because whitespace is an argument delimiter, that is being evaluated.
It runs ls, saves the result of ls into a pseudo variable, but that pseude variable is not put anywhere, neither as an argument for another command like "echo $(ls)" or as a value for a 'real' variable.
So it's executed as a command, but your filename starts with Inner and then a whitespace, so it stops there and you get your mess.
If you want to delay ls in a subshell, which a set of ()s create (note the lack of dollar sign at the front) AND as a background:
Then it's something like
I don't see any practical use of that though, so maybe you should be asking something else, like...how to solve whatever task you want solved BEFORE arriving at this kind of solution for it.
Cause that solution is weird. Makes me think that your problem is weird somewhere, try to redesign the problem to make it less weird, if you can.