代码之家  ›  专栏  ›  技术社区  ›  jsstuball

nohup:trailing“&”是否阻止写入输出文件?

  •  0
  • jsstuball  · 技术社区  · 6 年前

    版本1无法写入我的output.txt文件:

    nohup python test.py &> output.txt &

    但是版本2可以工作:

    nohup python test.py &> output.txt

    我需要拖尾 & 因为我想在命令行上执行其他任务!

    1 回复  |  直到 6 年前
        1
  •  1
  •   jsstuball    6 年前

    解决了的: ... python -u ... 是答案。似乎这个附加选项可以防止python输出缓冲。