【问题标题】:How to direct output of time command to a file in shell script?如何将时间命令的输出定向到 shell 脚本中的文件?
【发布时间】:2017-01-18 13:52:50
【问题描述】:

这不会将时间命令的输出附加到file.txt

echo $(time openssl genrsa -aes128 -out server.key 1024) &> file.txt

【问题讨论】:

    标签: linux shell time append


    【解决方案1】:

    您可以使用以下内容:

     {time openssl genrsa -aes128 -out server.key 1024} 2>> file.txt
    

    【讨论】:

      猜你喜欢
      • 2023-03-30
      • 1970-01-01
      • 2010-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多