The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script required to get a required info from file. Pls. help me. ntgobinath Shell Programming and Scripting 2 05-31-2008 05:34 AM
Help required on awk meetavin Shell Programming and Scripting 3 04-18-2008 06:47 AM
SSL help required binums HP-UX 0 05-03-2006 11:03 PM
Help required on DBX Sumanth SUN Solaris 1 07-29-2004 06:54 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-11-2006
Registered User
 

Join Date: May 2006
Posts: 25
Post Help required.

Hi,
Iam relatively new to Shell scripting.
............
.........
Cur_log_file=`ls -lrt LOGFILE* | grep 'Jun 30' | tail -1`
...............
..................
Iam trying to find some log file name to check their status, using above script line.
If the log file is not avaible then rest of the programs are not getting executed. I want to continue the program even if the log file not exist.

Thanks in advance.
Lokesha
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-12-2006
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 255
from the script it seems that you are taking the most recent file modified on jun 30.but how this is stoping other programs to run is not clear i assume that execution of other script is dependent on "Cur_log_file".

You need to elaborate how other program runs.....
Reply With Quote
  #3 (permalink)  
Old 07-12-2006
Registered User
 

Join Date: May 2006
Posts: 25
Red face

Yes Dhruva.
Execution of other script is dependent on "Cur_log_file" such log file status, run date and order date etc.,
Cur_log_file is current log file.
Iam using while loop to find all jobs log status, if 'ls -lrt' failed to find "Cur_log_file" then it is displaying error message saying
"No such file or directory" and process is hanging.

Thanks for your concern,

Lokesha
Reply With Quote
  #4 (permalink)  
Old 07-14-2006
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 255
Hi Lokesha, You can try with this script.first you check that if the Cur_log_file contains the file and not the "no such file or directory" err message.So if that file exist then in IF statement use the script which checks your current log status run date and order date etc.,



Cur_log_file=`ls -lrt LOGFILE* | grep 'Jun 30' | tail -1`
file_name=`echo $Cur_log_file | awk'{print $9}'`
if [ -f $file_name ] then
use your script after this if statement...........
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0