How to run a command in the background and get no output?

前端 未结 8 977
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 05:28

I wrote two shell scripts a.sh and b.sh. In a.sh and b.sh I have a infinite for loop and they print some output to the te

相关标签:
8条回答
  • 2020-12-04 05:51

    These examples work fine:

    nohup sh prog.sh proglog.log 2>&1 &

    For loop you can use like this :

    for i in {1..10}; do sh prog.sh; sleep 1; done prog.log 2>&1 &

    It works in background and does not show any output.

    0 讨论(0)
  • 2020-12-04 05:55
    nohup sh -x runShellScripts.sh &
    
    0 讨论(0)
提交回复
热议问题