Generally Linux commands print their version on stdout
, for example
git --version
or python --version
. But not ssh
. ssh -V
prints output to stderr
.
To test it you can do the following:
git version on stdout
> git --version 2> error 1> output
> cat output
git version 2.51.0
ssh version on stderr
> ssh -V 2>> error 1>> output
> cat error
OpenSSH_9.9p1, OpenSSL 3.2.4 11 Feb 2025
Hope this will be helpful.