Set start point in script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Set start point in script
# 1  
Old 04-19-2005
Set start point in script

Does anyone know of a way to set up some sort of marker in a shell script, from which the script can be restarted..

e.g.

MARKER1
check env variable MAX_RETRY
if var not set then
while true
do
check var
if set go to MARKER1
else sleep
done
fi

ANy ideas?
# 2  
Old 04-19-2005
what are you trying to do? ... btw, your test as i understand it will never hold true as you're checking for an environment variable that should already be set BEFORE the script gets to the test ... if not already set, who's going to set it?
# 3  
Old 04-19-2005
I wouldnt necessarily do it this way but you could set a flag within the shell (preferably at the top of the script) using sed. Basically, create a pattern that is unique so that you can use a simple sed statement to set a shell variable before the shell exits. If the shell is restarted it could perform work based upon the setting of this variable. To make this work you would need to create a function that is a single point of exit within the script. Anything goes wrong you call the function, runs the sed, and exits gracefully.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed with shell script to search and replace a set of strings among the set of files

Hi, I am looking for a shell script which serves the below purpose. Please find below the algorithm for the same and any help on this would be highly appreciated. 1)set of strings need to be replaced among set of files(directory may contain different types of files) 2)It should search for... (10 Replies)
Discussion started by: Amulya
10 Replies

2. AIX

How to set the break point using dbx?

Hi, I am trying to debug my project using dbx to understand the code and functionality of modules. I compiled all my C files using gcc -g flag to enable the debug option. I was able to get in to the debug mode using dbx. I was able to create breakpoints using stop at line no. "stop at... (7 Replies)
Discussion started by: Sachin1987
7 Replies

3. Shell Programming and Scripting

How to perform a hexdump using dd from start point to end point?

hi, I would like to ask or is it possible to dump a hex using dd from starting point to end point just like the "xxd -s 512 -l 512 <bin file>" I know the redirect hexdump -C but i can't figure it out the combination options of dd. Hope someone can share their knowledge.. Thanks in... (3 Replies)
Discussion started by: jao_madn
3 Replies

4. Shell Programming and Scripting

Fetching a set of lines with start and end

Hi Folks, Need help in fetching a group of lines with a start and end strings. Example is shown below. start#morning tea jog breakfast end start#afternoon lunch work chat end start#evening snacks tea chat (6 Replies)
Discussion started by: jayadanabalan
6 Replies

5. AIX

When AIX audit start, How to set the /audit/stream.out file size ?

Dear All When I start the AIX(6100-06)audit subsystem. the log will save in /audit/stream.out (or /audit/trail), but in default when /audit/stream.out to grow up to 150MB. It will replace the original /audit/stream.out (or /audit/trail). Then the /audit/stream.out become empty and... (2 Replies)
Discussion started by: nnnnnnine
2 Replies

6. Shell Programming and Scripting

deleting the part of the file(overwrite) using start and end point

here is the contents of bigfile.sql CREATE TABLE `Table11` ( `id` int(11) NOT NULL , `entityName` enum('Lines','EndUsers') COLLATE utf8_unicode_ci NOT NULL, `parentAllianceMigrationProjectId` varchar(255) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=2000 DEFAULT CHARSET=utf8... (30 Replies)
Discussion started by: vivek d r
30 Replies

7. Shell Programming and Scripting

Need to start a script from the point where it failed.

Hi Guys, I have requirement where if the script fails at a particular point, then the script should run from that particular point itslf.. could anyone help me out from this.. Thanks (5 Replies)
Discussion started by: mac4rfree
5 Replies

8. UNIX for Advanced & Expert Users

Fibre connection Point to Point SUN

Anyone know of a guide or instructions for Solaris I got to configure a SBUS HBA to talk to a tape robot. I have done this on a switch but not point to point. just going HBA >>>>> TAPE Fibre simple two nodes Kie (6 Replies)
Discussion started by: kie
6 Replies

9. UNIX for Dummies Questions & Answers

Set up apache to point at my homepage

I have just install apache 1.3.22 on my solaris 2.6 with virtualhost which is working fine but I want to configure my httpd.conf file so that when I type in my url on an internet browsers it goes straight to my home page. eg www.mydomain.com should display my home page at the monent when I type... (4 Replies)
Discussion started by: hassan2
4 Replies
Login or Register to Ask a Question