Hi all,
How do I continuously tail a modified file?. Please read this carefully. I know "tail -f" will do the trick. But tail -f will work half way if we move the file to different name and work on the same file with fresh data.
example:
---------------------------
-- test.sh
x=0
while [ $x -eq 0 ]
do
touch test.log
echo "Mydate: `date`" >> test.log
sleep 10
done
----------------------------------
>./test.sh
>tail -f test.log
It will tail the file continuously, but if we move the log, tail -f will no longer tail.
example:
> mv test.log test.bkp
Running "tail -f test.log" will hang/not tail any longer.
How do I make the tail process continuous even we move the file?
Rgds,
Suhaimi
How do I continuously tail a modified file?. Please read this carefully. I know "tail -f" will do the trick. But tail -f will work half way if we move the file to different name and work on the same file with fresh data.
example:
---------------------------
-- test.sh
x=0
while [ $x -eq 0 ]
do
touch test.log
echo "Mydate: `date`" >> test.log
sleep 10
done
----------------------------------
>./test.sh
>tail -f test.log
It will tail the file continuously, but if we move the log, tail -f will no longer tail.
example:
> mv test.log test.bkp
Running "tail -f test.log" will hang/not tail any longer.
How do I make the tail process continuous even we move the file?
Rgds,
Suhaimi