LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-06-2008, 05:45 PM   #1
lundq1kp
LQ Newbie
 
Registered: Jun 2008
Posts: 1

Rep: Reputation: 0
C Shell - Traversing a file


I am currently trying to write a C Shell script that informs the user when a processing job has finished. I have a file that can be continually updated about the processing jobs.


When the job is in progress the file looks like this

Job id Name User Time Use S Queue
------------------- ---------------- --------------- -------- - -----
3962.master MM-PBEPBE juanp 1150:19: R verylong
3964.master MM-PBE1PBE juanp 1069:31: R verylong
3987.master MMC-SVWN5 juanp 660:32:0 R verylong
4031.master MM-9-PBEPBE juanp 304:06:5 R verylong
4032.master MM-9-PBE1PBE juanp 303:58:4 R verylong
4033.master MM-9-HSE1PBE juanp 54:08:48 R verylong
4034.master MM-9-B3LYP juanp 20:30:58 R verylong
4076.master MM-HF juanp 03:21:22 R verylong
4077.master MM-HSE1PBE juanp 0 Q verylong
4110.master ...ex1-1.7-ULSDA thuk 120:19:1 R verylong
4145.master ...1.87-UHSE1PBE thuk 23:21:48 R verylong
4149.master Cusp-H karl 0 Q short

And when the job has finished, it looks like this

Job id Name User Time Use S Queue
------------------- ---------------- --------------- -------- - -----
3962.master MM-PBEPBE juanp 1150:19: R verylong
3964.master MM-PBE1PBE juanp 1069:31: R verylong
3987.master MMC-SVWN5 juanp 660:32:0 R verylong
4031.master MM-9-PBEPBE juanp 304:06:5 R verylong
4032.master MM-9-PBE1PBE juanp 303:58:4 R verylong
4033.master MM-9-HSE1PBE juanp 54:08:48 R verylong
4034.master MM-9-B3LYP juanp 20:30:58 R verylong
4076.master MM-HF juanp 03:21:22 R verylong
4077.master MM-HSE1PBE juanp 0 Q verylong
4110.master ...ex1-1.7-ULSDA thuk 120:19:1 R verylong
4145.master ...1.87-UHSE1PBE thuk 23:21:48 R verylong

With the bottom entry missing.

How would I write a C Shell scipt to inform me, or be able to proceed with other instructions when the the file no longer contains the bottom entry.
 
Old 06-06-2008, 06:41 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Start by looking up the man pages for "tail" and "grep". Maybe also "sleep".

Last edited by syg00; 06-07-2008 at 02:26 AM. Reason: Amended sed to grep
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a shell script to turn a lined file into a comma seperated file Thaidog Linux - General 8 03-08-2008 07:19 PM
Traversing files in a given directory using a bash script kaujot Programming 7 03-07-2008 12:39 PM
How to do non-recursive Binary Tree LNR Traversing? Mr_Shameless Programming 3 04-29-2007 09:35 PM
Recursively traversing sub-directories ark86 Linux - Newbie 2 01-29-2006 01:15 PM
Traversing from previous post c0rk3y *BSD 1 07-26-2002 09:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration