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
Restart process brendan76 SuSE 3 02-26-2008 12:43 PM
need help: shell script to restart apache when no. of processes keeps growing _joshua_ Shell Programming and Scripting 14 03-07-2007 08:06 AM
Restart Script chapmana UNIX for Dummies Questions & Answers 1 11-27-2006 11:21 AM
need help to write script to check the process health and automatically restart it dragondad Shell Programming and Scripting 1 10-31-2006 06:16 PM
suspend/restart a process in shell script daneensign Shell Programming and Scripting 1 02-14-2006 12:43 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 07-02-2002
indo1144's Avatar
indo1144 indo1144 is offline
Registered User
  
 

Join Date: Jun 2002
Location: Netherlands
Posts: 54
Question How to restart a script from the top

Hi folks!

I'm starting to get pretty good at this, I still have a question left. I can't seem to figure out how to start a script from the top once it completes...

SunOS 5.7 with Bash 2.01.

Here's a "schedule" of my script:


1. First I have some functions declared
2. The functions are called
3. Then display result
4. Next I need to start from top without quiting script

Is there a way to use "goto" as you would in DOS-batch language? I know that there is no "goto" command in Bash and know from the Advanced Bash-Scripting Guide that functions will do exactly the same.

However, I can't seem to make it work...
  #2 (permalink)  
Old 07-02-2002
Deepa Deepa is offline
Registered User
  
 

Join Date: Apr 2002
Posts: 53
If your intention is to execute the steps:1 through 3, in a loop indefinitly, just put the steps :2 through 3 inside an indefinite while loop.

Else, just give the command to invoke your shell script, in the last line of your shell script.

Deepa
  #3 (permalink)  
Old 07-02-2002
indo1144's Avatar
indo1144 indo1144 is offline
Registered User
  
 

Join Date: Jun 2002
Location: Netherlands
Posts: 54
Quote:
Step 1
while (true)
do
Step 2
Step 3
done
Did the trick! Thanks for the reply!
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:27 PM.


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