Output LFTP result to variable

This question already has an answer here:

  • How to set a variable to the output of a command in Bash? 13 answers

  • 使用Command SubstitutionCommand Substitution的输出存储在变量中:

    output=`lftp -c 'open -e "mirror /path/to/remote /path/to/local/" ftp://username:password@ftp.domain.com:21'`
    echo "Test: ${output}" 
    
    链接地址: http://www.djcxy.com/p/57216.html

    上一篇: bash脚本:找不到命令

    下一篇: 将LFTP结果输出到变量