我想用一次lftp -c
完成一个整个会话(因为稍后我将从脚本中启动它),-e
但我设法做到了,但是ofc却让我参与了我不想使用的交互式会话。
手动状态
-c commands
Execute the given commands and exit. Commands can be separated with a semicolon, `&&'
or `||'. Remember to quote the commands argument properly in the shell. This option
must be used alone without other arguments.
但是我不明白我应该如何正确地将命令/交互引用和字符串在一起。
lftp -e "put -O remote/dir/ /local/file.txt" -u user,pass ftpsite.com
效果很好。但是我想在执行命令后退出;
lftp -c "open -u user,pass ftpsite.com" || put -O "remote/dir/ /local/file.txt"
只是对我大喊大叫,或者实际上我尝试过的任何报价组合(||
或&&
无论如何)
只需添加; quit或; bye :)
—
meso_2600 2014年