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
Perl Substition with multiple conditions EDALBNUG UNIX for Dummies Questions & Answers 4 09-25-2008 04:15 PM
Multiple conditions in find or ls stmts mavsman UNIX for Dummies Questions & Answers 5 04-01-2008 05:57 PM
Multiple Logical Operator Issues ... srikanthgr1 Shell Programming and Scripting 1 05-14-2007 08:27 AM
multiple conditions in if/then grandtheftander UNIX for Dummies Questions & Answers 4 07-21-2006 02:58 PM
multiple conditions in if statements tim mauger Shell Programming and Scripting 3 04-28-2002 10:42 AM

Closed Thread
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
  #1 (permalink)  
Old 12-30-2008
codeman007 codeman007 is offline
Registered User
  
 

Join Date: Sep 2008
Location: US
Posts: 32
multiple conditions in if using && operator

VARIABLE="project"
if [ [ -n "$VARIABLE" ] && [ $VARIABLE == "project" ] ]
then
echo "VARIABLE is not empty"
fi


this is not working what is wrong in the syntax??
  #2 (permalink)  
Old 12-30-2008
lorcan lorcan is offline
Registered User
  
 

Join Date: May 2007
Posts: 219
Code:
if [[ -n "$VARIABLE"  &&  $VARIABLE == "project" ]]
  #3 (permalink)  
Old 12-30-2008
codeman007 codeman007 is offline
Registered User
  
 

Join Date: Sep 2008
Location: US
Posts: 32
thanks lorcan

its working ...i wasted one hour on this...
Closed Thread

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