|
#1
|
|||
|
|||
send scp command with path .
How do I send an scp command?
I cant seem to be able to figure out how to do the characters after the host. scp -p -r myfile root@host:/path/to/dir/ Code:
crt.Screen.Send("ssh -oStrictHostKeyChecking=no root@" + host + '\r') |
#2
|
|||
|
|||
Hi rleon,
Sorry to appear dense, but I don't understand what you don't understand. ![]() Also, your question is about scp, but then the example code is ssh? I assume "/path/to/dir/" is a literal string, you would just treat it as such: Code:
crt.Screen.Send("ssh -oStrictHostKeyChecking=no root@" + host + ":/DirA/DirB/DirC/etc" + '\r') or crt.Screen.Send("scp -p -r my file root@" + host + ":/DirA/DirB/DirC/etc" + '\r')
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Hi Brenda
lol sorry I wasnt clear Code:
crt.Screen.Send("scp -p -r -oStrictHostKeyChecking=no ssh_client.tar root@" + host + ":/root" + '\r') For some reason its putting an extra character in there. Code:
# scp -p -r -oStrictHostKeyChecking=no ssh_client.tar root@myhost [rleon:/home/rleon]# :/root -bash: :/root: No such file or directory |
#4
|
|||
|
|||
Hi rleon,
I would say then that the info read from the hosts file includes an extra end of line character that needs stripped! ![]()
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
hmmm I checked that ..
No extra characters. |
#6
|
||||
|
||||
The extra char(s) are there, you just won't be able to see them since they're non-printing.
This should demonstrate for you what's going on: Code:
with open('/Users/rleon/Documents/hosts.5') as hosts_: for host in hosts_: crt.Dialog.MessageBox(host.replace("\r", "[CR]").replace("\n", "[LF]")) --Jake
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|