Sponsored Content
Operating Systems Linux SuSE "ssh suse-server 'python -V' > python-version.out" not redirecting Post 302769897 by Druonysus on Wednesday 13th of February 2013 08:04:49 PM
Old 02-13-2013
Question "ssh suse-server 'python -V' > python-version.out" not redirecting

Okay, so I have had this problem on openSUSE, and Debian systems now and I am hoping for a little help. I think it has something to do with Python but I couldn't find a proper Python area here.

I am trying to redirect the output of "ssh suse-server 'python -V'" to a file. It seems that no matter what I try, it always prints to stdout. Here is an example of what I am doing.

Code:
user@suse-envy4t:~> ssh suse-server 'python -V' > python-version.out 
not a terminal
Python 2.7.3
user@suse-envy4t:~> cat python-version.out
user@suse-envy4t:~> ssh suse-server 'python -V' | tee  python-version.out 
not a terminal
Python 2.7.3
user@suse-envy4t:~> cat python-version.out

Now, I realize that I could just log into the box and do this but I have a lot of systems to do this on. I want to to rap this in a forloop and so I can get a list of what version of python all the boxes have on them... not being able to capture the output of "python -V" is really making this a pain. I hope this is something stupid that I am doing wrong but "ssh suse-server 'cat /etc/issue'" can redirect just fine with >, >>, or tee... so I don't know what I am doing wrong.

Last edited by jim mcnamara; 02-13-2013 at 09:51 PM..
 

9 More Discussions You Might Find Interesting

1. AIX

SSH has this error: "server refused our key"

I did successful yestday as Porter's doc: 1. Create private/pub key on AIX: $ssh-keygen -t identity 2. Get my private key from the AIX server, found in $HOME/.ssh/identity Put that on Windows box. I use WinSCP to transfer private key from AIX to Windows 3. Run puttygen.exe and... (8 Replies)
Discussion started by: rainbow_bean
8 Replies

2. AIX

"pconsole" and "esaadmin" on AIX version 6

Anyone know what is the function of user "pconsole" and "esaadmin" on AIX version 6? (1 Reply)
Discussion started by: ebab3
1 Replies

3. HP-UX

Unable To Perform A "Passwordless" SSH Login To A Server

Greetings! I am trying to perform a passwordless SSH login from a HPUX 11.31 client to a HPUX 11.31 server. Whenever I do a "ssh -l root serverA" from the client, I am prompted for a password. Giving the password, I am able to successfully login. However I am trying to accomplish a... (9 Replies)
Discussion started by: Rob Sandifer
9 Replies

4. Shell Programming and Scripting

Python 2.5 / 2.2 import "errno" fails on AIX Server

I am trying to import the "xmlrpclib" Module from Activepython 2.5 in einer older Python 2.2. Already achived this on a SUSE Linux server, but I am now required to do it on a AIX server. Resolved the first few error messages by copying files from Activepython to Python but I can't get the... (0 Replies)
Discussion started by: frieling
0 Replies

5. UNIX for Dummies Questions & Answers

What is the significance of sh -s in ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh?

Please can you help me understand the significance of providing arguments under sh -s in > ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh (4 Replies)
Discussion started by: Sree10
4 Replies

6. Shell Programming and Scripting

Unable to store "python --version" to a shell variable

Hi All, I need to get the version of python installed and store it in a variable for later use. Whereas it is printing on the console instead of storing to variable. I am able to store output of ls command in a variable. Please check the below code : root@myhost:/volumes/srini# cat... (4 Replies)
Discussion started by: srinivasan.neel
4 Replies

7. Programming

Obfuscated "Hello World!" in Python 2.7.x...

Obfuscated Hello World! in Python 2.7.x This is seriously impressive:- Obfuscating "Hello world!" - Ben Kurtovic (2 Replies)
Discussion started by: wisecracker
2 Replies

8. Programming

[Python] replicating "sha256 -C checksum_file.txt file.txt"

Hello everyone, Since my python knowledge is limimted, I've challenged myself to learn as much as possible to help me with my carrere. I'm currently trying to convert a shell script to python, just to give myself a task. There is one section of the script that I'm having issues converting and... (2 Replies)
Discussion started by: da1
2 Replies

9. Programming

Python : Problem with " TypeError: float() argument must be a string or a number "

Hello ! I'm creating a CGI which allow to display graph from some data. The datas looks like : 2020-01-13-00-00,384.00,350.00 2020-01-13-06-00,384.00,350.00 2020-01-13-12-00,384.00,350.00 2020-01-13-18-00,384.00,350.00 2020-01-14-00-00,384.00,350.00... (1 Reply)
Discussion started by: Tim2424
1 Replies
PYCENTRAL()															       PYCENTRAL()

NAME
pycentral - register and build utility for Python packages SYNOPSIS
pycentral [-h] [-v] <cmd> [<cmd options>] [<args>] DESCRIPTION
pycentral provides support for installing python modules independent of the current installed Python version and handling byte-compilation and -removal tasks in installation scripts. OPTIONS
-v, --version Limit the output to the version numbers of the python versions. -h, --help Print a help text. pycentral has the following sub commands. For fine grained help, call: pycentral <cmd>. bccompile Byte compile .py files in a package. bcremove Remove the byte compiled .py files. list List all managed files. pkginstall Make a package available for all supported runtimes. pkgprepare Prepare a package for all supported runtimes. pkgremove Remove a package installed for all supported runtimes. pkglist List pycentral-managed files of a package for all supported runtimes. rtinstall Make installed packages available for this runtime. rtremove Remove packages installed for this runtime. updatedefault Update the default python version. debhelper move files to pycentral locaation, variable substitutions (called by dh_pycentral). pycentraldir <package> Show the installation directory used by pycentral for <package>. showdefault Show default python version number. Deprecated, use pyversions(1) showsupported Show the supported python versions. Deprecated, use pyversions(1) showversions Show version numbers of supported python versions. Deprecated, use pyversions(1) dh_pycentral, should not be called directly). version Show the pycentral version. FILES
/etc/python/debian_config is searched for the attribute overwrite-local. If set to 1, or True, existing files in /usr/lib/pythonX.Y/*-packages are overwritten with symbolic links to the pycentral install area. The default is to abort the installation of a package, when files already exist. This behaviour may be useful, when python libraries were manually installed into this directory. The attribute byte-compile can be set to a comma separated list of the values standard and optimze to indicate how files should be byte- compiled. SEE ALSO
pyversions(1), Python policy. AUTHOR
Matthias Klose PYCENTRAL()
All times are GMT -4. The time now is 05:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy