BASH

Sean seanlkml at sympatico.ca
Sat Dec 4 16:46:48 UTC 2004


On Sat, December 4, 2004 11:36 am, Bill Gradwohl said:

> I use debug code and lots of functions already, and I have some scripts
> that are over 4000 lines long.
>
> When a script exits abnormally, I'm looking for a convenient way to
> quickly modify the script to immediately "goto" where the last execution
> left off and continue on.
> i.e. while setting up the drive array as previously described, if the
> fdisk fails for whatever reason, and the script terminates, I want to
> make a fix to the script to bypass the parts that already ran
> successfully and retry the fdisk and continue on down thru the end of
> the script.
>

Bill,

Sorry my previous post didn't really comprehend what you were trying to
do.    You're right, there is no goto.   You could comment out all lines
preceding the line you want to start at....

For example, to comment out all the lines from 2 to 450:

:2,450s/^/#/

And then afterward remove the comments with:

:2,450s/^#//

Not pretty, but maybe good for what you need?

Cheers,
Sean





More information about the fedora-list mailing list