473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How do you use " " whe sending a command

Hello,



I am trying to pass the following command



ssh IP_address "ssh IP_address ls"



How you do that in Python?

/" ?

"/ ?



p = os.popen('ssh.exp ' + MGMT_IP + ' ' + /" ssh + PMI_IP_NODE1 + ' ' +
/bin/tdslog -C "/')





Thanks for the help...



-F


Jul 18 '05 #1
2 1416
So close:

\"
or \' in a '' string.

Jul 18 '05 #2
"Fernando Armenta" <fa******@pillardata.com> schrieb im Newsbeitrag news:ma**********************************@python.o rg... Hello,

I am trying to pass the following command

ssh IP_address "ssh IP_address ls"

How you do that in Python?
/" ?
"/ ?
a = " ' "
b = ' " '
c = """ " ' ''' """
d = ''' " ' """ ''''
p = os.popen('ssh.exp ' + MGMT_IP + ' ' + /" ssh + PMI_IP_NODE1 + ' ' + /bin/tdslog -C "/')

But a imho better way would be:

vars = {'mgmt_ip': '10.0.0.1', 'ip':'10.0.0.2', 'cmd':'/bin/ls'}
command = 'ssh.exp %(mgmt_ip)s "ssh %(ip)s %(cmd)s"' % vars
p = os.popen

HTH

Ciao Ulrich
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael Flanagan | last post by:
Of course "echo" is working, but I've got a case where php doesn't seem to be sending out the result of an "echo." I'm probably doing something wrong, but I can't see it. I've got the following...
0
by: Tony Kwong | last post by:
I am using my mobile phone as modem to send some SMS using modem AT commands and have the SerialPort.DataReceived to get the "reply" from the Port using "m_SerialPort.ReadExisting();" private...
28
by: john_sips_tea | last post by:
Just tried Ruby over the past two days. I won't bore you with the reasons I didn't like it, however one thing really struck me about it that I think we (the Python community) can learn from. ...
9
by: EdWhyatt | last post by:
Hi all, I have searched the group with no answer to this particular problem. In my sendmail program, I would like to have the ability to send a mail message with no-one email address in the To...
19
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
3
by: ManningFan | last post by:
Due to the way our IT group has set up our servers, we are not allowed to use the Shell() command. We are already doing a similar action with an FTP command. Our code is thus: sExe =...
2
jbellis
by: jbellis | last post by:
Can someone direct me to a good explanation or complete code example of sending a response from a perl script? I suspect that I don't even understand what's going on because web searches don't show...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.