In bash, standard (1) and error (2) output can be re-routed and discarded with:
>/dev/null 2>&1
But the following example does something different:
nohup myscript.sh >myscript.log 2>&1 </dev/null &
What is the meaning/function of </dev/null
in the example above? In what sort of scripting scenario would it be useful?
(Example Source)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…