The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Checking the existence of a file.. igandu Shell Programming and Scripting 7 06-13-2007 12:47 AM
checking file existence DILEEP410 Shell Programming and Scripting 3 01-24-2007 08:43 AM
File existence problem anormal UNIX for Dummies Questions & Answers 2 05-15-2006 09:54 AM
Loop for file existence bd_joy UNIX for Dummies Questions & Answers 2 02-02-2006 08:51 AM
Searching for the existence of a file sbhan UNIX for Advanced & Expert Users 2 10-14-2002 01:02 PM

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

Join Date: Mar 2006
Posts: 89
Stumble this Post!
File existence

Hey all,

I have total new with shell scripting so I don't know if what I need to do even possible, here it is...for a duration of time (say...1 hour) I need to check for the existence of a particular file, if it exists then I will invoke a java program or I will continue to check until a) the file is found and break out of the loop to invoke program b) time is up and no file is found then write error out to screen. Any sample would be greatly appreciated! Thanks in advance!

Pang
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-27-2006
Klashxx's Avatar
HP-UX/Linux/Oracle
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 371
Stumble this Post!
Code:
inter=0
interval=10

while [ inter -le 0 ]
do
    if [ -f ${FILE} ]
    then
        # INVOKE JAVA PROGRAM
        break
    fi
    sleep ${interval}
    (( inter += interval ))
file
Reply With Quote
  #3 (permalink)  
Old 03-27-2006
Klashxx's Avatar
HP-UX/Linux/Oracle
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 371
Stumble this Post!
I mean .....

Quote:
Originally Posted by Klashxx
Code:
while [ ${inter} -le 3600 ] #For 1 hour
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:09 AM.


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

Content Relevant URLs by vBSEO 3.2.0