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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Come and work for me! (UK) TonyChapman Linux 2 03-25-2008 01:08 AM
Script doesn't work, but commands inside work cheongww UNIX for Dummies Questions & Answers 2 11-14-2006 06:52 PM
How does tee work Foxgard UNIX for Dummies Questions & Answers 1 06-18-2005 12:58 PM
Will this work? Ypnos Shell Programming and Scripting 5 07-24-2003 10:51 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-31-2007
Registered User
 

Join Date: Dec 2007
Posts: 11
Talking if Condtion does not work

hi


this code not work in c shell
Code:
	@ f =$<
	if ( ( $f != 50 ) || ( $f != 2 ) ) then
echo "error "

endif

Do I find assistance؟
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-31-2007
Registered User
 

Join Date: Dec 2007
Posts: 208
I think what you want is the logical and &&. not the logical or ||

Code:
@ f =$<

if ( ( $f != 50 ) && ( $f != 2 ) ) then
   echo "error "
endif
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




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


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0