I'm struggling to understand why following does not work as expected in
$ myvar='"some stuff"' $ echo $myvar "some stuff" $ cd $myvar bash: cd: "some: No such file or directory
I know the
canonical way is to (How to use cd with shell variable containing spaces):
$ myvar="some stuff" $ echo $myvar some stuff $ cd "$myvar"
But e.g. here https://stackoverflow.com/a/12258418/881191 answer by Alex for macOS advices to escape quotations, which I also tried and it's the same as putting double quotations inside single ones in my case. Why in one case
cd gets two parameters and in other two from as I see it same "some stuff"?