Hi,
I have written a small script from that iam appending the output to a file.If multiple users invoke the same script or if i invoke the same script n number of times (using &), the output file(ZZ/OUT) contains messup information.
#!/bin/bash
#
echo "Hello" >> /tmp/ZZ/OUT
sleep 10
echo "World" >> /tmp/ZZ/OUT
sleep 10
echo "---------end -----------" >> /tmp/ZZ/OUT
sleep 5
cat OUT
Hello
Hello
Hello
World
World
World
---------end -----------
---------end -----------
---------end -----------
I would like to know is there any possibility to get consistent output like log file (/var/log/message) for any number of time script invocation. like below.
Hello
World
---------end -----------
Hello
World
---------end -----------
Thnx for the suggestion.
however I want some sort of syncronization technique to my script so tht my output is consistant.Otherwise I need a mechanism how the log file(/var/log/messages) use to append automatically.