[Info-vax] /END=label
Bill Gunshannon
bill.gunshannon at gmail.com
Mon Aug 27 18:13:31 EDT 2018
On 08/27/2018 03:55 PM, Stephen Hoffman wrote:
> On 2018-08-27 19:13:50 +0000, John Reagan said:
>
>> On Monday, August 27, 2018 at 1:49:13 PM UTC-4, Stephen Hoffman wrote:
>>> On 2018-08-27 17:26:18 +0000, John Reagan said:
>>>
>>>> bash doesn't even have a 'goto' and people have to resort to using
>>>> case statements to case on the result (no different than looking at
>>>> $STATUS and IF/THEN/ELSE'ing on the result)
>>>
>>> "Prepare to cringe": https://bobcopeland.com/blog/2012/10/goto-in-bash/
>>
>> I saw that one and promptly gouged out my eyes. However, that isn't
>> what what the OP wanted. That just does "goto" by cloning the script,
>> editing it on the fly, and invoking the cloned script. None of that
>> was done under program control.
>
> Yeah; I know. It was in response to your reference to a lack of goto in
> bash, and not to the OP's request for DCL.
>
> csh is one of the few shells I've used that does have goto. There are
> probably others with goto. Use of case and traps are common in bash.
> There's also no direct analog for an EXIT and DEBUG traps in DCL.
>
> I haven't encountered a shell script that does what Bill indicates was
> possible on Unix and that did provide an analog to what the OP wanted
> and DCL and that whether csh or otherwise.
>
> What Bill was referencing wasn't clear, and could well have been a
> mis-reading of the original question around error handling. Like you,
> I'm not aware of a way to do what the OP was requesting within bash or a
> couple of other shells. Hence that portion of your reply was expunged
> from my reply.
>
>
I thought he was asking for a way to do something in DCL (and
later in Dave's comment) or a Unix Shell. A trivial and quite
common task in Unix. No goto required. A switch statement or
a bunch of If/then/else statements. My choice of shells is
still C-shell, but I don't think I have ever used goto. It's
probably the only thing me and Dykstra ever agreed on.
John, if this is what was desired, I can throw together a
simple C program with return values and a shell script that
will react to that return value. Would only take a few
minutes.
bill
More information about the Info-vax
mailing list