由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - what's wrong with this ftp batch file?
相关主题
unix下编译fortran 的错误太多,看不到怎么办?some useful (hopefully) sed command
how to use batch file to ftp files in UNIX?can anyone post a FTP auto get script ?
Question about I/O redirection.magnetic tape?
能这样么?adding more swap space command...
How to monitor peak memory usage?Socket programming help
请教How to get rid of the bg job id redirection?Key in Shared Memory
请诊断:HELP, a question about the library path,
[转载] Hidden character in a fileCGI之Perl Script一问
相关话题的讨论汇总
话题: ftp话题: netrc话题: batch话题: file话题: yangpwd
进入Unix版参与讨论
1 (共1页)
j*******r
发帖数: 201
1
I just wrote a batch file to download files by ftp like this:
ftp -n 128.104.1.1
user yang yangpwd
ascii
verbose
cd data
get aaa.zip
close
bye
But after being connected, it stopped before verifying username
and password. Can anyone tell me what's wrong?
Thanks a lot,
w*****n
发帖数: 94
2
the ftp program always tries to get username and password from tty,
instead of stdin which can be redirected. the solutions are:
1) put username and password in $HOME/.netrc file, or
2) use expect

【在 j*******r 的大作中提到】
: I just wrote a batch file to download files by ftp like this:
: ftp -n 128.104.1.1
: user yang yangpwd
: ascii
: verbose
: cd data
: get aaa.zip
: close
: bye
: But after being connected, it stopped before verifying username

s*****d
发帖数: 258
3
of course it won't work since ftp is an interactive process.
use expect to do this job.

【在 j*******r 的大作中提到】
: I just wrote a batch file to download files by ftp like this:
: ftp -n 128.104.1.1
: user yang yangpwd
: ascii
: verbose
: cd data
: get aaa.zip
: close
: bye
: But after being connected, it stopped before verifying username

j*******r
发帖数: 201
4
Here is my .netrc ( username: yang pwd:yangpwd)
"machine 128.10.1.5 login yang password yangpwd"
The problem is when I run ftp 128.10.1.5, it said
Error - .netrc file not correct mode.
Remove password or correct mode.
Can any daxia tell me how to fix this?
Thanks.

【在 w*****n 的大作中提到】
: the ftp program always tries to get username and password from tty,
: instead of stdin which can be redirected. the solutions are:
: 1) put username and password in $HOME/.netrc file, or
: 2) use expect

w*****n
发帖数: 94
5
make .netrc only readable and writable by yourself.
chmod 600 .netrc

【在 j*******r 的大作中提到】
: Here is my .netrc ( username: yang pwd:yangpwd)
: "machine 128.10.1.5 login yang password yangpwd"
: The problem is when I run ftp 128.10.1.5, it said
: Error - .netrc file not correct mode.
: Remove password or correct mode.
: Can any daxia tell me how to fix this?
: Thanks.

c**o
发帖数: 166
6
try:
ftp -n > /dev/null < open 128.104.1.1
user yang yangpwd
bin
cd data
get aaa.zip
bye
EOF

【在 j*******r 的大作中提到】
: I just wrote a batch file to download files by ftp like this:
: ftp -n 128.104.1.1
: user yang yangpwd
: ascii
: verbose
: cd data
: get aaa.zip
: close
: bye
: But after being connected, it stopped before verifying username

j*******r
发帖数: 201
7
多谢各位大侠指点,终于搞定了。
1 (共1页)
进入Unix版参与讨论
相关主题
CGI之Perl Script一问How to monitor peak memory usage?
file problem in unix请教How to get rid of the bg job id redirection?
[转载] 请教请诊断:
有没有四舍无入的函数?[转载] Hidden character in a file
unix下编译fortran 的错误太多,看不到怎么办?some useful (hopefully) sed command
how to use batch file to ftp files in UNIX?can anyone post a FTP auto get script ?
Question about I/O redirection.magnetic tape?
能这样么?adding more swap space command...
相关话题的讨论汇总
话题: ftp话题: netrc话题: batch话题: file话题: yangpwd