|
Search Forums:
|
|||||||
| Forums | Register | Forum Rules | Linux and Unix Links | Man Pages | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
if no file then quit
I have a script that run several subscripts. I need to find out how to do two things. First I would like to check for a file and if that file is not there I want to quit the entire script without running the rest of the script which contain subscripts. If the file is there, I want it to continue running.
I would also like to know how to tell it to try again in 1 hour but only up to three times. I already have a script that runs twice daily and just want to insert the script in the existing code. |
| Sponsored Links | |
|
|
|
#2
|
||||
|
||||
|
Code:
if [ ! -f "/my/file" ] ; then exit 0; fi |
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to quit from a script? | caro | Shell Programming and Scripting | 8 | 01-29-2010 03:54 AM |
| perl how to exit a while loop and quit reading the input file | subhap | Shell Programming and Scripting | 1 | 11-04-2009 02:51 AM |
| detect file size then quit or continue | steven99 | UNIX for Dummies Questions & Answers | 5 | 01-22-2009 12:32 PM |
| Script to check for a file, check for 2hrs. then quit | mmarsh | UNIX for Dummies Questions & Answers | 2 | 09-16-2005 02:46 PM |
|
|