Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Branching within a shell script NOT using functions

Status
Not open for further replies.

debih99

Programmer
Mar 22, 2001
7
US
A co-worker of mine has a very large Unix shell script that was coded without the use of functions :(, not something I would do, but....

Is there a label in Unix, say like the goto stmt where he can just branch to another section of code in leu of re-writting it using functions?

I have checked my resource manuals, but have come up empty handed.

Thanks

 
Unfortunately there isn't a "goto label" type command in shell scripts, so a rewrite is probably needed. Speaking from my own experience, a rewrite would probably be a worth the effort. You'll appreciate it when it comes to altering the script in future. :)
 
AndyBo,

Thanks, I didn't think I ever saw a 'goto' label in Unix shell, but sometimes the 'former' Cobol programmer in me comes out and I can't remember where I saw what!

I will suggest to him altering the shell to use functions.

Debi :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top