I am using a terminal only so no GUI and using Free Pascal 2.6.2. If I have a screen that begins on line 5 I can use the arrow keys to move down to say line 26, and if I get to line 27 it goes back to line 5, and line 4 wraps to line 25. All good and works with enter if a line is selected.
My...
Need to open a file and if a new line is appended, then need to print it.
Opening the file is no problem, but how does one check if a new line has been recently appended to the log file?
Thanks for your reply, I first tried awk then gawk and get the following error:
# gawk '/^host/{h0=$0;continue}{print h0":"$0}' pkgs.txt |sort -d |awk -F':' '{if(h0!=$1){h0=$1;print h0} print $2}'
gawk: (FILENAME=pkgs.txt FNR=1) fatal: `continue' outside a loop is not allowed
I have some data
host3719
NK-JDK170_25_32-1.7.0_25-25.i686
NKJAS-JBOSS-ENV-1.0-24.x86_64
NKJAS-JBOSS-EWS_64-2.0.1-3.x86_64
NK-JDK170_25_64-1.7.0_25-25.x86_64
NKSGI-AGENT-JBOSS-1.0-9.x86_64
host7723
NKSGI-AGENT-JBOSS-1.0-9.x86_64
NK-JDK170_25_64-1.7.0_25-25.x86_64...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.