Advertisement

12.19.2007 at 04:56AM PST, ID: 23033245
[x]
Attachment Details

How do I accomplish a goto in Bourne shell?

Asked by Angela_Wilcox in Shell Scripting, IBM AIX Unix

Tags: shell, bourne, loop

I understand goto's are poor programming - but I have some rather lengthy shell scripts I have to test.  If everything works but the last 10 lines - I need to run through script for say the first 2 steps to initialize and than I want to skip down to the last 10 lines to retest those.  Currently - I am cutting and pasting to create a smaller version of the script - but this is always a potential area for errors on reassmbly.  So I would like to be able to make my code SKIP a big chunk.  Thought about If loops - but cannot think how I would get that to work.  Any ideas from some of you pro scripters?Start Free Trial
 
Loading Advertisement...
 
[+][-]12.19.2007 at 06:42AM PST, ID: 20499799

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Shell Scripting, IBM AIX Unix
Tags: shell, bourne, loop
Sign Up Now!
Solution Provided By: Kdo
Participating Experts: 1
Solution Grade: A
 
 
[+][-]12.19.2007 at 06:56AM PST, ID: 20499908

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.19.2007 at 07:09AM PST, ID: 20500010

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.19.2007 at 07:13AM PST, ID: 20500042

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628