Strange behaviour surrounding "ssh -T ..." and non-zero exit
Peter Krefting
peter at softwolves.pp.se
Sat Nov 10 17:44:03 AWST 2018
2018-11-09 17:52 skrev W. Michael Petullo:
> Here is a more practical example which demonstrates the problem:
>
> $ echo false | dbclient -T root at host.example.com
> $ echo $?
> 0
That is because $? contains the exit status of the left-most command
(echo), not the pipe. If you are using a bash shell, you need to use
PIPESTATUS to find it, read more at:
https://unix.stackexchange.com/a/73180
--
\\// Peter - http://www.softwolves.pp.se/
More information about the Dropbear
mailing list