Actually, the problem disappeared so I have no idea actually happened.
It was probably a mistake on my side.

Le dimanche 8 novembre 2020 à 01:28:25 UTC+1, jmc...@gmail.com a écrit :

> Probably need to defer interpretation of $? - looks like it may be getting 
> evaluated early.
>
> On Sat, Nov 7, 2020 at 4:23 AM Johan Mazel <johan...@gmail.com> wrote:
>
>> 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
>>
>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation of those guidelines may result in your removal from this mailing 
>> list.
>>  
>> GitHub Issues: https://github.com/hashicorp/vagrant/issues
>> Discuss: https://discuss.hashicorp.com/c/vagrant/24
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Vagrant" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to vagrant-up+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vagrant-up/24b4eaa7-795d-4cbd-b30c-87fe1b9c7307n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/vagrant-up/24b4eaa7-795d-4cbd-b30c-87fe1b9c7307n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/hashicorp/vagrant/issues
Discuss: https://discuss.hashicorp.com/c/vagrant/24
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vagrant-up+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/84f31f2d-68bd-4a65-92ac-ce5a40dff4ebn%40googlegroups.com.

Reply via email to