Why just don't you report then write to file? The way you choose to go is like reinventing the wheel.. What you want to do with the write, read and report thing? Also, please do try to be more specific to get an better ideea of what you want to do and probably sugest you something even better.
Once the game is over, the king and the pawn go back in the same box.
caesar wrote:Why just don't you report then write to file? The way you choose to go is like reinventing the wheel.. What you want to do with the write, read and report thing? Also, please do try to be more specific to get an better ideea of what you want to do and probably sugest you something even better.
Thanks for your reply.
I need this because the data is written to the file by another script, which is not even done in tcl.
So basicly i want the tcl script to monitor the log file, and output every new line that is written to it
Then how dose it know WHEN to read from the log file and paste the news? Also, can't you use an TCL script to do the same thing your "another script" is doing?
Once the game is over, the king and the pawn go back in the same box.
caesar wrote:Then how dose it know WHEN to read from the log file and paste the news? Also, can't you use an TCL script to do the same thing your "another script" is doing?
It should check the logfile every lets say 5 seconds.
It's not possible to redo the other script in tcl
How should it know what are thouse new lines? I't possible to complicate it a bit and make it remember the last line he read but.. why is not possible to make that script to TCL?
Once the game is over, the king and the pawn go back in the same box.
Because the other script is a shell script which asks for information from the user, then logs its action to a file.
There is a way to do this, because i've seen it in action but didnt see the code.
hmm, well maybe i could make it check if the filesize of the log gets bigger, compared to its previous filesize (this is done at the start of the script). And if the filesize is bigger, it does a tail -n1 to get the latest line
difoo wrote:How did you solve it? I'm looking for a similar script it seems impossible to do
use a utimer (to check every 1-5 seconds) and what bisbis said
bisbis wrote:hmm, well maybe i could make it check if the filesize of the log gets bigger, compared to its previous filesize (this is done at the start of the script). And if the filesize is bigger, it does a tail -n1 to get the latest line
I'm not able to code it myself, that's why I was looking for an existing script. What it should do is parse the output from /var/log/httpd.conf in #mycastle everytime the logfile gets updated (via apache when a user access my website)