Hello
I created a setup single box which a Debian Buster.
I am trying to execute a command in a box and get its return code printed to stdout.
I run "ls; echo $?; ls toto; echo $?" where toto is not present.
On the host, the ouput is:
*content of directory*
0
ls: cannot access 'toto': No such file or directory
2
I get the 2 value because toto is not present.
Then I do "vagrant ssh client -c 'ls; echo $?; ls toto; echo $?'" (toto is again not present), and I get the following output:
*content of directory*
0
ls: cannot access 'toto': No such file or directory
0
Why is the return code/status of the second ls 0?
Thank you for your time.
Best regards,
Johan Mazel