![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need to write a script in UNIX to find a file if another file exists | mmdawg | Shell Programming and Scripting | 1 | 05-04-2008 11:40 PM |
| Check File Exists and compare to previous day file script | rbknisely | Shell Programming and Scripting | 3 | 02-07-2008 11:53 AM |
| checking a connection still exists? | fishman2001 | IP Networking | 2 | 12-14-2007 07:45 AM |
| File exists and is empty | dstinsman | UNIX for Dummies Questions & Answers | 5 | 02-09-2006 11:05 AM |
| Please help me with this script meant for checking /etc/passwd if a name exists | TRUEST | Shell Programming and Scripting | 4 | 03-04-2002 11:29 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Checking the file if it exists
Hi
This will be useful who is looking for checking the files in a directory #chmod 777 /cronacle/tools/teradata/opo/bin/file_check.sh SUBJECT=`echo "File Not Found"` SUBJECT1=`echo "File Found"` #RECIPIENT=Madhu.Reddy@ge.com cd /cronacle/tools/teradata/opo/bin file_list=attach.sh if [ -s $file_list ] then echo $file_list "$SUBJECT1" | mailx -s "$SUBJECT1" abc@abc.com exit 1 else echo $file_list "$SUBJECT" | mailx -s "$SUBJECT" abc@abc.com --mail id exit 0 fi Thanks Babu |
|
||||
|
slight difference
Quoting from man test Code:
-e FileName
Returns a True exit value if the specified FileName exists.
-s FileName
Returns a True exit value if the specified FileName exists and has a size greater than 0.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|