![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| (Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script | praka | Shell Programming and Scripting | 6 | 04-15-2009 07:09 AM |
| Need help in creating a Unix Script to parse xml file | Anil.Wmg | Shell Programming and Scripting | 10 | 07-29-2008 07:58 AM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 05:25 AM |
| file reading in unix | pradeepthanraj | Shell Programming and Scripting | 2 | 11-15-2005 09:35 AM |
| Reading Particular Line From A File in Unix | yeheyaansari | UNIX for Advanced & Expert Users | 2 | 02-12-2002 08:42 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
UNIX script for reading a file and creating another file
Hi,
I am a beginner in scripting...I have to do a script where I have to read a file which has list of job names, line by line and for every line execute a dsjob command to find the log details of the job and extract only the start time of the job, if it is greater than jan 01 2008 and create an output file which has the jobname that I read followed by a comma and the start time stamp value. If I execute the dsjob (datastage) command for a job A12TRANJB, the expected results are: dsjob -jobinfo DDW A12TRANJB Job Status : NOT RUNNING (99) Job Controller : not available Job Start Time : Tue Feb 17 22:17:10 2009 Job Wave Number : 0 User Status : not available Job Control : not available Interim Status : NOT RUNNING (99) Invocation ID : not available Last Run Time : not available Job Process ID : 0 Invocation List : A12TRANJB The highlighted job start time value in line 3 is the one i have to compare and if it is greater than 01/01/08, I have to write that to a file, with the job name, A12TRANJB. I have a unix coding done for this, I know that there would be lot of mistakes..I have it here below: HTML Code:
jobname= /apps/Ascential/Projects/jobnames for line in $jobname do dsjob -jobinfo $jobname PRJ | grep `job start time` | cut -f2 -d > newfile can some one please help me in this scripting? thanks, Vijay |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|