The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
help needed in using case statement jisha Shell Programming and Scripting 0 01-16-2008 04:33 AM
case statement bkan77 Shell Programming and Scripting 5 09-11-2007 05:54 PM
multiple Logical statement mahabunta UNIX for Dummies Questions & Answers 3 10-03-2006 12:28 PM
Case Statement Zeta_Acosta Shell Programming and Scripting 19 04-06-2004 04:16 PM
case statement Bab00shka Shell Programming and Scripting 1 07-15-2002 05:31 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-10-2006
hcclnoodles hcclnoodles is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 272
Logical AND within a case statement ??

Hi there, probably a really simple question to answer but i cant seem to find it

can I use a logical AND (&&) within a CASE statement ie (ps this is useless syntax but youll get the idea
Code:
                       case "$var1","$var2" in

                            'Billy' && 'Bobby')
                                
                                echo "do some stuff"
                             ;;
                            
                            'Peter' && 'Bobby')
                                
                                echo "do some other stuff"
                             ;;
                            
                        esac
  #2 (permalink)  
Old 11-10-2006
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,416
You can do somthing like this:
Code:
case "$var1,$var2" in
   Billy,Bobby)
      echo "do some stuff"
      ;;
   Peter,Bobby)
      echo "do some other stuff"
      ;;
esac
Jean-Pierre.
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 01:48 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