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
Imitating DOS functionality: The Call Statment jadionne UNIX for Dummies Questions & Answers 21 12-25-2007 08:01 AM
what is wrong with my awk statment? hankooknara Shell Programming and Scripting 1 06-18-2007 08:27 PM
How to redirect value from sql select statment to unix variable abdulhafeez Shell Programming and Scripting 16 12-26-2006 07:40 AM
hwo do I print ' in an awk statment? baraka UNIX for Advanced & Expert Users 7 11-30-2006 03:57 AM
problem w/ -z && -n switches in an if statment Optimus_P Shell Programming and Scripting 1 07-31-2002 07:22 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-16-2008
Registered User
 

Join Date: May 2008
Posts: 1
if statment, based on retune value

hello
im working on a project for the iphone to write a termainal based program
we have bsd subsystem installed so have access to most unix command

i have a executable called coordinates, which get the coordinates of the iphone

when this runs it returns to the terminal the text of "success" or the text of "failed"

i want to write a shell script that will run different code for each, somthing like

if (result of coordinates = "success") then
{chunk of code1}
else
{chunk of code2}

end if


anyone got any ideas that could help?

thanks.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-16-2008
Registered User
 

Join Date: Jul 2006
Posts: 189
Code:
return=$(coordinates)
if [ $return == Success ]
then
 some thing
fi
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:15 PM.


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

Content Relevant URLs by vBSEO 3.2.0