Sponsored Content
Top Forums Shell Programming and Scripting Use “tail -f” to monitor and report, but the top line should be always fixed on the screen. Post 302763811 by gary_w on Wednesday 30th of January 2013 01:11:15 PM
Old 01-30-2013
Code:
#!/bin/ksh

while :
do
  clear
  printf "tab1\ttab2\ttab3\ttab4"
  tail -9 test001.log
  sleep 5
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Looking for monitor/top

I'm new to SUN (SunOS 5.8) and I can't find any monitoring tools to check cpu, memory, disk ... performance. Previously on unix servers I have used 'top' & 'monitor' but these commands are not on the box on in the man pages. Anyone suggest equivalent commands? (1 Reply)
Discussion started by: pavelmac
1 Replies

2. Shell Programming and Scripting

Bash tail monitor log file

Hi there, I have a problem here that involves bash script since I was noob in that field. Recently, I have to monitor data involve in logs so I just run command tail -f for the monitoring. The logs was generate every hour so I need to quickly change my logs every time the new hour hits according... (2 Replies)
Discussion started by: kriezo
2 Replies

3. What is on Your Mind?

Can you use a gps touch screen for a monitor?

I have been looking for a monitor wich i can hold in my hands comfortably and just sit back and relax with it doing my computer work on it via touch screen. Is it possible since the gps has usb to control my pc wich it? and view my desktop? If not does anyone know of a monitor that would work. Im... (3 Replies)
Discussion started by: FaoX666
3 Replies

4. Shell Programming and Scripting

How to print string on screen according the fixed length?

Problem: entry_name="joke:hello:yellow:blue:default" print("%d %-12s\t%-10s\t%-5s\n", $i, $entry_name....); I just want to print the output like this index entry value .... 1 joke:hello:y 0 123 567 ellow:blue:d ... (1 Reply)
Discussion started by: a2156z
1 Replies

5. Shell Programming and Scripting

tail command not show on screen

Hi, I'm moniroting duplicate text with unix command (tail -f trace75747 | grep 'duplicate'), but it showed many lines then it stop show trace information although trace information in this file trace75747 always got. What should I do? I look forward to hearing from you. THANKS! (10 Replies)
Discussion started by: seyha_moth
10 Replies

6. Shell Programming and Scripting

How do I get my script to monitor a new file using tail?

Hi, I have a script which basically watches a log file for new lines using tail, then takes action based on what is logged. I wrote a script to do this for me and its working great, my only problem is that once per week, this log file is archived to another directory, and a new log is created.... (4 Replies)
Discussion started by: lstorm2003
4 Replies

7. Shell Programming and Scripting

Script to Monitor a Process with Top.

Hi, I have written a script to monitor a Process with the help of top command. This is my script. ====================== #!/bin/sh DATE=`date +%Y%m%d%H%M%S` HOME=/home/xmp/testing/xmp_report RADIUS_PID=`xms -xmp sh pr | grep "RADIUS.iamsp02ldv" |awk '{ print $3 }'` PSE_PID=`xms -xmp sh... (5 Replies)
Discussion started by: Siddheshk
5 Replies

8. Red Hat

command line tool to disable screen lock and/or screen saver

Hi, I have a simple question : how to disable screen lock and/or sreen saver with command line with RHEL5.4 ? (1 Reply)
Discussion started by: albator1932
1 Replies

9. War Stories

One time I fixed an LCD monitor with a folded piece of paper

Some of the colors weren't working on the Monitor. I found pressing around the plastic border of the screen brought them back. I opened the monitor casing and used the folded paper to put pressure against the LCD panel and housing. Wah Lah. More of a bend than a hack I guess. (2 Replies)
Discussion started by: herot
2 Replies

10. Red Hat

Screen Resolution on External Monitor from RHEL 6.3

Hey everyone, I have a KVM or External monitor (19" Dell) that I am trying to hook up to a laptop running RHEL 6.3 (via VGA which is the only option). When I connect it, and go to System->Preferences->Display, the max resolution option it provides me for these external devices is 1280x1024. ... (2 Replies)
Discussion started by: rchaud10
2 Replies
tail(1) 																   tail(1)

NAME
tail - deliver the last part of a file SYNOPSIS
/usr/bin/tail [ +-s number [lbcr]] [file] /usr/bin/tail [-lbcr] [file] /usr/bin/tail [ +- number [lbcf]] [file] /usr/bin/tail [-lbcf] [file] /usr/xpg4/bin/tail [-f | -r] [-c number | -n number] [file] /usr/xpg4/bin/tail [ +- number [l | b | c] [f]] [file] /usr/xpg4/bin/tail [ +- number [l] [f | r] ] [file] The tail utility copies the named file to the standard output beginning at a designated place. If no file is named, the standard input is used. Copying begins at a point in the file indicated by the -cnumber, -nnumber, or +-number options (if +number is specified, begins at distance number from the beginning; if -number is specified, from the end of the input; if number is NULL, the value 10 is assumed). number is counted in units of lines or byte according to the -c or -n options, or lines, blocks, or bytes, according to the appended option l, b, or c. When no units are specified, counting is by lines. The following options are supported for both /usr/bin/tail and /usr/xpg4/bin/tail. The -r and -f options are mutually exclusive. If both are specified on the command line, the -f option is ignored. -b Units of blocks. -c Units of bytes. -f Follow. If the input-file is not a pipe, the program does not terminate after the line of the input-file has been copied, but enters an endless loop, wherein it sleeps for a second and then attempts to read and copy further records from the input-file. Thus it can be used to monitor the growth of a file that is being written by some other process. -l Units of lines. -r Reverse. Copies lines from the specified starting point in the file in reverse order. The default for r is to print the entire file in reverse order. /usr/xpg4/bin/tail The following options are supported for /usr/xpg4/bin/tail only: -c number The number option-argument must be a decimal integer whose sign affects the location in the file, measured in bytes, to begin the copying: + Copying starts relative to the beginning of the file. - Copying starts relative to the end of the file. none Copying starts relative to the end of the file. The origin for counting is 1; that is, -c+1 represents the first byte of the file, -c-1 the last. -n number Equivalent to -cnumber, except the starting location in the file is measured in lines instead of bytes. The origin for counting is 1. That is, -n+1 represents the first line of the file, -n-1 the last. The following operand is supported: file A path name of an input file. If no file operands are specified, the standard input is used. See largefile(5) for the description of the behavior of tail when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). Example 1: Using the tail Command The following command prints the last ten lines of the file fred, followed by any lines that are appended to fred between the time tail is initiated and killed. example% tail -f fred The next command prints the last 15 bytes of the file fred, followed by any lines that are appended to fred between the time tail is initi- ated and killed: example% tail -15cf fred See environ(5) for descriptions of the following environment variables that affect the execution of tail: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. The following exit values are returned: 0 Successful completion. >0 An error occurred. See attributes(5) for descriptions of the following attributes: /usr/bin/tail +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ /usr/xpg4/bin/tail +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWxcu4 | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ cat(1), head(1), more(1), pg(1), dd(1M), attributes(5), environ(5), largefile(5), standards(5) Piped tails relative to the end of the file are stored in a buffer, and thus are limited in length. Various kinds of anomalous behavior can happen with character special files. 13 Jul 2005 tail(1)
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy