shell - ftp 用户名和密码在 shell 脚本中自动生成

标签 shell

我想创建.sh文件

// Tried to connect to ftp server
ftp name_of_server   
 //input user name
username
 //input password
password 

链接如下 https://github.com/prokid221/shell-programing.git

它再次要求输入用户名和密码,而不是登录。 谁能帮忙解决这个问题吗?

最佳答案

如果您只需要文件传输,可以使用curl。

下载文件:

curl -O -u user:password ftp://example.com/some-file

上传文件:

curl -T some-file -u user:password ftp://example.com

注意:此方法可能会导致您的凭据保存在命令历史记录中。

关于shell - ftp 用户名和密码在 shell 脚本中自动生成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36316334/

相关文章:

ruby - 使用 Ruby 查找早于 X 小时的文件

linux - ls 查找所有以 ./开头的目录

Bash 长选项/标志 - 怎么做?

linux - 脚本执行完成后如何打印成功消息?

bash - 在 'source' 的 Dockerfile 中使用 RUN 指令不起作用

bash - 如何在一个文件 linux 中提取所有命令历史记录

linux - shell 在读取文本文件时是否会将 <space> 与 <new line> 混淆?

java - 使用 bash 脚本重定向 java 输出 (liquibase)

bash - 我怎样才能正确地将多个 bash 脚本源到彼此?

linux - ^[ 在 shell 提示符下转义