SUMMARY: capture output of `ssh -V`to a variable

From: Loris Serena <Loris.Serena_at_esat.com>
Date: Tue Jul 20 2004 - 11:51:09 EDT
17 responses (and counting!) in less than 10 minutes.
That's goooood! ;-)

Ok, "ssh -V" redirects to STDERR, so something like 

SSH_VERSION=`ssh -V 2>&1`

will do the job just fine.


Thanks a mill to EVERYBODY

Loris




-----Original Message-----
From: Loris Serena 
Sent: 20 July 2004 16:16
To: 'sunmanagers@sunmanagers.org'
Subject: capture output of `ssh -V`to a variable


List, 

This is one that deserves a SUMMARY when solved!

I'm trying to capture the output of ssh -V into a variable.

The command
SSH_VERSION=`/usr/local/bin/ssh -V`
actually returns the output of the command to the screen and nothing into
the variable!

$ SSH_VERSION=`ssh -V`
OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
$ echo $SSH_VERSION

$


I've tried this on a Solaris 8 x86 with Open SSH 3.8.1 and also on a Solaris
9 SPARC with SUN_SSH 1.0 and got the same results on both boxes with ksh, sh
or bash!!!

Even if I try something like:

ssh -V > pluto

I get

$ ssh -V > pluto
OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
$ ls -l pluto
-rw-r--r--   1 bb       bb             0 Jul 20 16:12 pluto
$

Any idea, anyone?

Cheers

Loris





Esat Telecommunications Limited 
is a wholly owned subsidiary of BT Group plc 
Registered in Ireland, Registration No. 141524 
Grand Canal Plaza, Upper Grand Canal Street, Dublin, Ireland 

This electronic message contains information (and may contain files) from
Esat Telecommunications Limited which may be privileged or confidential. The
information is intended to be for the sole use of the individual(s) or
entity named above. If you are not the intended recipient be aware that any
disclosure, copying, distribution or use of the contents of this information
and or files is prohibited. If you have received this electronic message in
error, please notify us by telephone or email (to the numbers or address
above) immediately. http://www.esatbt.com
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



Esat Telecommunications Limited 
is a wholly owned subsidiary of BT Group plc 
Registered in Ireland, Registration No. 141524 
Grand Canal Plaza, Upper Grand Canal Street, Dublin, Ireland 

This electronic message contains information (and may contain files) from
Esat Telecommunications Limited which may be privileged or confidential. The
information is intended to be for the sole use of the individual(s) or
entity named above. If you are not the intended recipient be aware that any
disclosure, copying, distribution or use of the contents of this information
and or files is prohibited. If you have received this electronic message in
error, please notify us by telephone or email (to the numbers or address
above) immediately. http://www.esatbt.com
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Tue Jul 20 11:51:31 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:35 EST