gpt4 book ai didi

shell - 创建一个 bash 文件用于通过 tftp 传输文件

转载 作者:行者123 更新时间:2023-12-02 04:12:07 25 4
gpt4 key购买 nike

我想创建 shell 脚本来调用特定文件的 tftp 传输到我的本地机器

这是我想做的操作

tftp 172.2.22.2
get file1_in_remote location file2_in_local_machine
quit

但我无法让它工作,因为当第一个 tftp 命令执行时,控件将进入 tftp 提示符。它看起来像这样

tftp>

它不会接受我在 shell 脚本中给出的第二个和第三个命令。

但是当我退出 tftp 提示符时,bash 会打印一条错误消息,如

get: command not found
quit: command not found

那么我怎样才能完成它

编辑 1:

tftp 173.32.52.12 -c get MyFile1.txt MyFile2.txt
tftp 173.32.52.12 -c get MyFile1.txt MyFile2.txt MyFile3.txt etc. etc.

这两个命令不适用于我的 ubuntu(14.0.4) 系统

最佳答案

你可以使用 atftp

安装:

sudo apt-get install atftp

使用:

atftp 172.2.22.2 -g -r /remote/file.txt -l /tmp/local.txt

关于shell - 创建一个 bash 文件用于通过 tftp 传输文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36176277/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com