【发布时间】:2014-09-19 14:22:28
【问题描述】:
我正在尝试运行服务器上的 Python 文件。 我这样写了 bash 脚本:
#!/bin/bash -x
ftp -in 100.200.100.200 << SCRIPTEND
user user password
binary
cd dem
ls # Works
python hello.py #Tried This doesnt work
./hello.py #Tried This doesnt work
/usr/bin/python hello.py #Tried This doesnt work
/usr/bin/python /full/path/hello.py #Tried This doesnt work
mkdir abc #Works
SCRIPTEND
我尝试将chown +x 提供给hello.py,然后尝试使用chown u+rx
请告诉我我的愚蠢错误是什么。
我在运行脚本时遇到的错误:
?Invalid command
?Invalid command
【问题讨论】:
-
只是为了确保 python 安装在服务器的某个地方,是吗?
-
您收到的错误信息是什么
-
ftp用于文件传输。你需要使用ssh,telnet, ... -
是的,Python 就在那里。 :D
-
第二个@falsetru。您不能通过
ftp运行命令。那样不行。