Sponsored Content
Full Discussion: updates only
Top Forums Shell Programming and Scripting updates only Post 302283339 by otheus on Tuesday 3rd of February 2009 05:44:30 AM
Old 02-03-2009
Can the file change anywhere? Or can lines only be added to it? If lines can only be added to it, just keep track of the last line number:
Code:
wc -l <filename> >/root/lastcheck-line.dat

Then a while later, do:
Code:
read L </root/lastcheck-line.dat
awk "NR==$L,0" <filename>  >/root/temp.txt

Once you're done, you can print the length again. You can do it altogether this way:
Code:
L=1; test -s /root/lastcheck-line.dat && read L </root/lastcheck-line.dat
awk "NR==$L,0 { print } END { print NR >'/root/lastcheck-line.dat' }" <filename>  >/root/temp.txt

 

7 More Discussions You Might Find Interesting

1. AIX

unix updates- Where can I find unix updates online for IBM servers?

I have a Unix based server running Sagitta and the server is giving me an error of 4b10004 and my research tells me this is an EPROM issue, which means the processor needs to be flashed or repaired. Once up and running where can I go to get updates for Unix? (1 Reply)
Discussion started by: crainer
1 Replies

2. UNIX for Advanced & Expert Users

multiple updates

Hi all, I would like to perform multiple updates within a single database open and close. Box: solaris dB: informix This is how i do perform for single update dbaccess <dbname> -<<EOF update table1 set col1=1 where col2=1 EOF i have the col1 values in a file (some 1000 values)... (1 Reply)
Discussion started by: matrixmadhan
1 Replies

3. Red Hat

RedHat Updates

All, I'm updating my redhat servers by directly connecting to internet (redhat network). After I connecting to the internet, I see some packages in package updater.I'm trying to do update but its stucking up when it is starting updating the server. Any ideas. Thanks (4 Replies)
Discussion started by: s_linux
4 Replies

4. UNIX for Dummies Questions & Answers

CentOS updates

hello all I Installed CenTOS 5.5 and i've Run yum update command every thing went smoothly but i got the following error at the end 6:kdebase-3.5.4-21.el5.centos.1.i386: Insufficient space in download directory /var/cache/yum/updates/packages * free 6.0 M * needed 28 M ... (2 Replies)
Discussion started by: abu_shiahb
2 Replies

5. Fedora

Installing updates

Hi, Im using Fedora version 23 (latest upgrade and upates). Currently to receive the updates, I use: su -c 'yum update' This works fine, but I get: yum command has been deprecated, redirecting to '/usr/bin/dnf update'. See 'man dnf' and 'man yum2dnf' for more information. To... (1 Reply)
Discussion started by: Janning
1 Replies

6. Shell Programming and Scripting

Cron updates

This cmd will update the user's crontab with the quoted line. But how to script the update using a previously stored variable? crontab -l | awk '{print} END {print "* * * * * echo test >> /tmp/testing"}' | crontab crontab -l | awk '{print} END {print "$storedvariable"}' | crontab Does not... (3 Replies)
Discussion started by: gtsonoma
3 Replies

7. HP-UX

Software updates?

On Hp-ux,I'm not talking about security patches.But free products like SecureShell. How to know if update is avaliable?On Solaris11 is possible using pkg update. On hpux?Some tool to check for outdated products and tell if new version is avaliable? ---------- Post updated at 03:24 AM... (1 Reply)
Discussion started by: Linusolaradm1
1 Replies
kst(1)								       kst2								    kst(1)

NAME
kst -- plots scientific data SYNOPSIS
kst kst [ -F DATASOURCE ] [ -f STARTFRAME ] [ -n NUMFRAMES ] [ -s FRAMESPERSAMPLE [ -a ] ] kstfile kst datasource [ -f STARTFRAME ] [ -n NUMFRAMES ] [ -s FRAMESPERSAMPLE [ -a ] ] [ -P PLOTNAME ] [ -A] [ -d ] [ -l ] [ -b ] [ -x FIELD ] [ -e FIELD ] [ -r RATE ] [ -y FIELD ] [ -p FIELD ] [ -h FIELD ] [ -z FIELD ] [ --png filename ] [ --print filename [ --landscape | --portrait ] [ --Letter | --A4 ] ] DESCRIPTION
kst is a graphical data plotting tool, which includes the ability to plot live data (contiuously update the plot as new data becomes avail- able). kst may be run entirely from within its GUI, in which case no command line arguments are needed. kst has a powerful wizard for easily set- ting up new plots. In the second invocation, kst loads pre-saved plot specifications from the file kstfile and optionally may override some of the settings in that file. In the third invocation, kst displays plots of the data as directed in the default manner. Additional datasources may be specified on the command line with options for that datasource following it. Command line options generally apply to all subsequent options unless later overridden. OPTIONS
-A plot all curves in separate plots -a average frames (simple mean) when plotting with -s. --A4 use A4 sized paper for printing. Requires --print. -b plot as bargraphs. -d use points when plotting curves. -e FIELD use FIELD as the magnitude of error bars applied to the next plot. -F datasource override the datasource indicated in the kstfile and instead use datasource. -f STARTFRAME begin plotting at STARTFRAME frames into the data. Set to -1 to start at NUMFRAMES from the end of the data. -h FIELD plot FIELD as a histogram. -l use lines when plotting curves. --landscape use landscape orientation for printing. Requires --print. --Letter use US Letter sized paper for printing. Requires --print. -n NUMFRAMES plot at most NUMFRAMES frames of data. Set to -1 to indicate all of the data. -P PLOTNAME plot all plots in the plot named PLOTNAME. -p FIELD plot FIELD as a power spectrum plot. --png filename render to a portable network graphics (png) image with file name filename and quit. --portrait use portrait orientation for printing. Requires --print. --print filename print the plot to file filename and quit. -s FRAMESPERSAMPLE plot every FRAMESPERSAMPLE frames when plotting. -x FIELD use FIELD as the X-axis vector. -y FIELD plot FIELD as an XY plot. -z FIELD plot FIELD as an image. EXAMPLES
Plot all data in column 2 from data.dat. kst data.dat -y 2 Same as above, except only read 20 lines, starting at line 10. kst data.dat -f 10 -n 20 -y 2 also read col 1. One plot per curve. kst data.dat -f 10 -n 20 -y 1 -y 2 Read col 1 from data2.dat and col 1 from data.dat kst data.dat -f 10 -n 20 -y 2 data2.dat -y 1 Same as above, except read 40 lines starting at 30 in data2.dat kst data.dat -f 10 -n 20 -y 2 data2.dat -f 30 -n 40 -y 1 Specify the X vector and error bars: Plot x = col 1 and Y = col 2 and error flags = col 3 from data.dat kst data.dat -x 1 -e 3 -y 2 Get the X vector from data1.dat, and the Y vector from data2.dat. kst data1.dat -x 1 data2.dat -y 1 Placement: Plot column 2 and column 3 in plot P1 and column 4 in plot P2 kst data.dat -P P1 -y 2 -y 3 -P P2 -y 4 BUGS
Please report bugs to either the kst mailing list at kst@kde.org or to the kde bugzilla under the kst product at http://bugs.kde.org/. If you can run kst, you can easily report bugs by selecting Bug Report Wizard from the Help menu. AUTHOR
Matthew Truch <matt@truch.net> LICENSE
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the `COPYING.DOC' file as part of the kst distribution. Version 2.0.3 22 February 2011 kst(1)
All times are GMT -4. The time now is 08:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy