Can anyone tell me what’s wrong in this code:
#!/usr/local/bin/python
import os
import string, sys
a='sys.argv[1]'
b='sys.argv[2]'
os.system("scp a:/export/home/sample/backup.sql b:/home/rushi/abc.sql")
it’s giving the following error:
ssh: a: node name or service name not known
What is wrong:
aandbdon’t have second and third values ofsys.argvas you might’ve intendedaandbare not related to theos.systemcallos.systemHow to fix:
a = sys.argv[1]without the quotes, same forb..formatmethod or similar%to format a stringsubprocessmodulestring