LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General > LinuxQuestions.org Member Intro
User Name
Password
LinuxQuestions.org Member Intro New to LinuxQuestions.org? Been a long time member but never made a post? Introduce yourself here.

Notices

Closed Thread
 
LinkBack Search this Thread
Old 10-07-2005, 05:22 PM   #1
sabliny
LQ Newbie
 
Registered: Oct 2005
Posts: 7

Rep: Reputation: 0
Question goto in linux shell script


Hi,

I am using Red Hat linux 2.4.21-4.EL.

I am trying to write a bash shell script to start an application.

If the application fails it will exit with certain exit code.

After checking the exit code, can I use 'goto' to jump to label in the script ?

for example:

<appname>
if [ $? -eq -2] goto label.

.
.
.
label:
..
..

thanks,

Sabliny
 
Old 10-13-2005, 03:00 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,068
Blog Entries: 4

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

Continue here.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
goto/label command for scripting in bash shell terry.trent Linux - Software 3 07-09-2010 10:15 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
can you use goto in bash script sabliny Programming 3 10-07-2005 05:54 PM
how to create a script that can goto different dir and also to run prompts ann124 Programming 5 11-29-2004 12:48 PM
linux shell script lightnup8 Linux - Newbie 4 01-27-2002 09:00 PM


All times are GMT -5. The time now is 08:13 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration