You don't need a while loop: "tail -f" is already an infinite loop until you manually terminate the process.
If you try:
Code:
tail -f file.log | grep "something" > output.txt
Your output file will remain empty until the grep buffer is flushed, which happens every "tot" bytes. If your grep version supports the option "--line-buffered" use it and you're done, otherwise you may need a while loop like:
Code:
tail -f file.log | while read LINE
do
echo "$LINE" | grep "something" >> output.txt
done
Hope this helps.