|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Title: Use “tail -f” to monitor and report, but the top line should be always fixed on the screen. Hi, dear Unix experts, I am trying to find a Unix command (or scripting) on how to continuously display a text file of its last several lines of contents. But during this displaying, I want some of the top lines are always displayed on the screen top when the scrolling contents reach the screen top. To make a simple, a text file “test001.log” is in its running process with the ending lines adding. Code:
tab1 tab2 tab3 tab4 tab5 0.9 5.0 17.7 9.7 19.9 0.6 9.1 4.3 0.6 41.9 0.0 2.8 14.9 5.0 5.6 0.2 5.8 62.4 17.3 41.5 0.6 8.0 74.9 0.7 19.4 0.7 4.3 48.1 2.8 30.3 0.0 5.3 0.3 16.4 42.8 0.2 7.8 70.8 11.6 10.8 0.6 7.5 89.4 19.7 34.9 0.4 2.5 88.5 0.1 22.7 0.4 1.1 41.3 8.4 18.6 Say, I want to use some commands like “tail –f”, but it will show a total number of 10 lines. The top line (possibly several lines in the middle) always shows “tab1 tab2 tab3 tab4 tab5”. The rest 9 lines show the last latest updated 9 lines. Such scrolling should not exceed outside my Unix screen shell. I’ve tried to search such function in many websites, but haven’t found useful information. I would think this function is very useful. But can I do it? ![]() Thanks in advance.
|
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Code:
#!/bin/ksh while : do clear printf "tab1\ttab2\ttab3\ttab4" tail -9 test001.log sleep 5 done |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
man console_codes:
Quote:
|
| Sponsored Links | ||
|
![]() |
| Tags |
| tail -f monitor head |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I get my script to monitor a new file using tail? | lstorm2003 | Shell Programming and Scripting | 4 | 06-06-2009 08:58 AM |
| tail command not show on screen | seyha_moth | Shell Programming and Scripting | 10 | 12-27-2008 09:26 AM |
| How to print string on screen according the fixed length? | a2156z | Shell Programming and Scripting | 1 | 10-24-2008 05:29 AM |
| Bash tail monitor log file | kriezo | Shell Programming and Scripting | 2 | 03-27-2006 11:01 PM |
| Looking for monitor/top | pavelmac | UNIX for Dummies Questions & Answers | 1 | 09-27-2005 11:12 PM |
|
|