Re: [ Attn: Randy ] Ad-hoc Parsing?

From: T.M. Sommers (tms_at_nj.net)
Date: 12/19/04


Date: Sun, 19 Dec 2004 07:42:21 GMT

Herbert Kleebauer wrote:
> Percival wrote:
>
>>I mean, user defined functions
>>
>>Like this in bash:
>>
>>#!/bin/bash
>>
>>function blah() { #this is a function
>> echo Hello World!!;
>>}
>>
>>blah #call the function twice
>>blah
>
> call :sub "hello world"
> call :sub "hello again"
> goto :eof
>
> :sub
> echo %1
> goto :eof

I have never seen that before, but from what you have written,
there appear to be significant differences. It look like you
need a goto to avoid executing the "function" when it is
encountered; that is not how the Unix shell works (assuming
POSIX/Korn/bash shells). Also, the "function" ends with a goto,
not a return (although this might be a typo). Do these batch
file "functions" have local variables? Can they be called from
other than the currently executing batch file (in Unix, you can
put such functions in your .profile and call them interactively)?
  Can the call other "functions"? Can they be called
recursively? And so on.

-- 
Thomas M. Sommers -- tms@nj.net -- AB2SB


Relevant Pages