Hello everyone!
This is the situation:
I execute this command from a bash script:
telnet 10.99.246.14 6001 >> output.txt
The question is:
How I do to execute this command and empty the buffer when is full?
The script is always running.
Thanks a lot!
What do you mean by buffer?
If by buffer you mean file, you could:
( telnet 10.99.246.14 6001 | split -a 4 -d -l 5000 - output. )
This will produce output.0000, output.0001, etc. split apart every 5000 lines. You can delete the old files and it will continue making new ones.
---------- Post updated at 02:24 PM ---------- Previous update was at 02:15 PM ----------
Actually, it can be far simpler. 'echo > output.txt' will clear it out.
I was referring to the console buffer...but with your help my problem is resolved.
Many thanks!