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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem with if, while, for conditions kittusri9 Shell Programming and Scripting 3 04-24-2008 10:15 AM
reduce the or conditions hitmansilentass Shell Programming and Scripting 8 05-03-2007 06:27 PM
multiple conditions in if/then grandtheftander UNIX for Dummies Questions & Answers 4 07-21-2006 02:58 PM
if statement with two conditions cin2000 Shell Programming and Scripting 1 01-23-2006 03:21 PM
if statement with two conditions -e, && yongho Shell Programming and Scripting 16 06-14-2005 05:46 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-25-2008
RRVARMA's Avatar
RRVARMA RRVARMA is offline
Registered User
  
 

Join Date: Feb 2008
Location: Bangalore, INDIA
Posts: 34
Exclamation How to giv two conditions in IF statement..??

Actually i need to satisfy both the condition..
lik i'm lookin for two different files.. and if BOTH the files r not present then it should run the followin script.. For example

inputfile1=data/in/inputfile1.txt
inputfile2=data/in/inputfile2.txt

if [ ! -f ${inputfile1} && ! -f ${inputfile2} ]
then

echo " "
echo "ERROR: Files not found."
echo " "
exit 1

fi


echo " "
echo "RUN SUCCESSFUL: Both Files found. "
echo " "

exit 1

Here even if the second file is not present its showing RUN SUCCESSFUL.. Please Help...
 

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 08:04 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