【问题标题】:How to export filename together with variable?如何将文件名与变量一起导出?
【发布时间】:2020-06-10 15:45:19
【问题描述】:

我的代码是:

a = 5335672
cat 1.txt 2.txt 3.txt > file_master_echo $a .txt

最后,我希望输出文件名是:

file_master_5335672.txt

【问题讨论】:

    标签: bash shell command


    【解决方案1】:

    那里没有必要使用echo(也必须指出这不是正确的使用方式)。另外,你cannot leave blank spaces when defining a variable。也就是说,试试吧:

    a=5335672
    cat 1.txt 2.txt 3.txt > file_master_$a.txt
    

    【讨论】:

      猜你喜欢
      • 2017-09-10
      • 1970-01-01
      • 2019-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多