Host A should execute a remote command (say pwd) on host B2.
B2 is not directly reacheable but you have to connect from a to B1, then from B1 you can execute the command ssh user@B2 pwd.
B1 and B2 are directly connected:
A => B1 => B2
| ^
|____pwd__|
Is there a way to use ssh from host A + single command to do the work?
Since I can't use expect I just tried to ssh twice:
ssh userB1@B1 "ssh userB2@B2 pwd"
I didn't thought about this solution, but it make sense (THANKS!!).