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 > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Reg expression For Harikrishna Shell Programming and Scripting 2 05-07-2008 01:40 AM
error: initializer expression list treated as compound expression arunchaudhary19 High Level Programming 12 11-16-2007 06:44 AM
Help with Reg. Expression moe2266 UNIX for Dummies Questions & Answers 7 07-16-2007 04:05 PM
KSH Expression tmarikle Shell Programming and Scripting 4 09-28-2005 04:27 PM
Regular Expression + Aritmetical Expression Z0mby Shell Programming and Scripting 2 05-21-2002 10:59 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 05-02-2007
Rock Rock is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 23
OR expression

Hi all,

I want to perform 'OR' for the following 3 variables.

rc1=1
rc2=1
rc3=1

rc=`${rc1} \| ${rc2} \| ${rc2} `

How can it be done?

Thanks,
Rock
  #2 (permalink)  
Old 05-03-2007
Rock Rock is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 23
I have amended the script as below.

rc=`expr ${rc1}` || `expr ${rc2}` || `expr ${rc3}`


But the following error prompted.

/work/proj/projtmp/testing.sh[3]: 1: not found.


Please give me some instructures for making 'OR' for these variable.

Thanks,
Rock
  #3 (permalink)  
Old 05-03-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
Code:
a=$(( 0 | 2 | 4 ))
echo $a
6
This is an arithmetic "or", is that what you want?
  #4 (permalink)  
Old 05-03-2007
Rock Rock is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 23
yes
thanks
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 12:39 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