The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 03:47 AM
checking file existence DILEEP410 Shell Programming and Scripting 3 01-24-2007 12:43 PM
File existence problem anormal UNIX for Dummies Questions & Answers 2 05-15-2006 12:54 PM
Loop for file existence bd_joy UNIX for Dummies Questions & Answers 2 02-02-2006 12:51 PM
Searching for the existence of a file sbhan UNIX for Advanced & Expert Users 2 10-14-2002 04:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-27-2006
mpang_ mpang_ is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 89
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
  #2 (permalink)  
Old 03-27-2006
Klashxx's Avatar
Klashxx Klashxx is offline Forum Advisor  
HP-UX/Linux/Oracle
  
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 393
Code:
inter=0
interval=10

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

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 393
I mean .....

Quote:
Originally Posted by Klashxx
Code:

while [ ${inter} -le 3600 ] #For 1 hour
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0