Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

How to write an OR statement

Shell Programming and Scripting


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 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 Unix and Linux 11-08-2005
RTM's Unix or Linux Image
RTM RTM is offline Forum Advisor  
Registered User
 
Join Date: Apr 2002
Last Activity: 6 August 2016, 11:44 AM EDT
Location: On my motorcycle
Posts: 3,093
Thanks: 1
Thanked 34 Times in 9 Posts
if [ .$1 = . ] || [ .$2 = . ] || [ .$3 = . ] ; then
echo "missing parameter"
fi
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 07:35 AM
read/write,write/write lock with smbclient fails swatidas11 IP Networking 1 03-05-2010 10:26 AM
How is use sselect statement o/p in insert statement. nkosaraju Shell Programming and Scripting 2 08-06-2008 09:26 PM
If statement - How to write a null statement april Shell Programming and Scripting 3 04-16-2008 01:14 PM
write statement into one file rinku Shell Programming and Scripting 5 06-25-2007 05:03 AM



All times are GMT -4. The time now is 07:29 PM.