How to write an OR statement | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


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

How to write an OR statement

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-08-2005
aukequist aukequist is offline
Registered User
 
Join Date: Nov 2005
Last Activity: 27 June 2006, 8:28 AM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
How to write an OR statement

Hi all,
I want to check if the first or the second or the third argument of call to a shell script is empty.

How do i do that in a short way. I watched some examples and i believe
if [ .$1 = . ] checks if an argument is NULL.

If so, how can i add the checks for argument 2 and 3 in the statement?

Thanks in advance
Auke Quist
Sponsored Links
    #2  
Old 11-08-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Registered User
 
Join Date: Apr 2002
Last Activity: 17 October 2014, 8:46 PM EDT
Location: On my motorcycle
Posts: 3,093
Thanks: 1
Thanked 32 Times in 9 Posts
if [ .$1 = . ] || [ .$2 = . ] || [ .$3 = . ] ; then
echo "missing parameter"
fi
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to write If statement using && and operator in Unix Avi Shell Programming and Scripting 2 06-01-2011 08:35 AM
read/write,write/write lock with smbclient fails swatidas11 IP Networking 1 03-05-2010 11:26 AM
How is use sselect statement o/p in insert statement. nkosaraju Shell Programming and Scripting 2 08-06-2008 10:26 PM
If statement - How to write a null statement april Shell Programming and Scripting 3 04-16-2008 02:14 PM
write statement into one file rinku Shell Programming and Scripting 5 06-25-2007 06:03 AM



All times are GMT -4. The time now is 08:10 PM.