将LFTP结果输出到变量

这个问题在这里已经有了答案:

  • 如何将变量设置为Bash中命令的输出? 13个答案

  • 使用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/57215.html

    上一篇: Output LFTP result to variable

    下一篇: Read result of sha256sum into a bash variable