我写了这样的文字:
#!/bin/bash
LOG_PATH=/root/cngiqos-log
LOG_NAME=term.log
TERM_PATH=/home/bnrcqos/qos_M11/term
test -d $LOG_PATH || mkdir -p $LOG_PATH
routeID= M11
if [ `ps -ef | grep term$ | grep -v grep | wc -l` -gt 0 ]; then
echo $routeID term process is already running
else
cd $TERM_PATH
(nohup ./term > $LOG_PATH/$LOG_NAME 2>&1 &)
fi
And I input "tail -f /root/cngiqos-log/term.log" and see the log, the log loss info, the log only output part of a log and then don t output any more. But when I input "./term" and run it in fg, the output is fine. Does any body know why? Is it a system bug?