command reordering

Thomas Binder binder at arago.de
Wed Mar 2 01:19:25 EST 2005


Hi!

On Tue, Mar 01, 2005 at 09:07:24AM -0500, matthew sporleder wrote:
> ssh myname at myhost 'printf %s: `hostname` ; ssh -V && printf %s:
> `hostname` ; php -v'
> 
> Will return something like:
> 
> myhost:myhost:OpenSSH_3.5etcetcetc
> 4.x.y
> 
> 
> Why is ssh putting the printf's together?

It doesn't - you have just overlooked that ssh -V sends its output
to stderr, while printf and php -v send it to stdout. Changing
your command line to

ssh myname at myhost 'printf %s: `hostname` ; ssh -V 2>&1 && printf %s: `hostname` ; php -v'

should work. (Assuming something sh-compatible as your login
shell, won't work that way with csh.)


Ciao

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20050301/9410746c/attachment.bin 


More information about the openssh-unix-dev mailing list