Re: bash subroutine syntax question



ToddAndMargo <ToddAndMargo@xxxxxxxxxxxxxxxxxx> writes:

s. keeling wrote:
ToddAndMargo <ToddAndMargo@xxxxxxxxxxxxxxxxxx>:
Just a trivia question. In bash subroutines

My Subroutine () {
...
}

Does anything go inside the "()"?

No, but that's incorrect as written.
The word "My" doesn't go there.

Not to my knowledge, but my "Learning the bash shell" is pretty old
and it may have changed.
Interpreted shell languages (sh, bash, ksh, zsh, ...) generally don't
pass values or pointers like C/C++, and they're limited to affecting
the environment and returning integer exit values (or they've since
evolved beyond what I've known of them).
I just go to perl when shell isn't up to it (and I'd like to learn
python one of these days).

Thank you for the reply. Seems to me it is just
window dressing.

I would love to learn Perl, but have never had the time.

It will save you time in the long run.
Trying to work around the shells inadequacies will take more time.
.



Relevant Pages

  • Re: Unexpected result from grep
    ... I'd worry about whether I should be using the shell at all. ... as big a deal as Perl. ... Most people can puzzle out even a complicated shell script and also ... seem to prefer ksh and it sure seems like a better shell to me. ...
    (comp.unix.tru64)
  • Re: Unexpected result from grep
    ... I'd worry about whether I should be using the shell at all. ... as big a deal as Perl. ... Most people can puzzle out even a complicated shell script and also ... seem to prefer ksh and it sure seems like a better shell to me. ...
    (comp.unix.shell)
  • Re: ActiveState: Cant spawn "cmd.exe"?
    ... >> When testing with ActiveState perl what shell are you running in? ... Normally, perl is built using MinGW in the cmd.exe shell, following the ... ActiveState perl, too) in a bash shell, though I've not personally done ...
    (comp.lang.perl.misc)
  • shell power vs. modern GUI IDE
    ... I think that the power of shell programming (particularly with the use ... scripting + perl with programming with IDEs like Eclipse or NetBeans. ... Perhaps one problem in vim is the source code browsing: ...
    (de.comp.os.unix.programming)
  • Re: how to easily determine shell script is running in background from within script
    ... That's not really the shell. ... That's the exit status of commands. ... process group of the terminal is the process' process group, ... There are a number of perl functions in the POSIX ...
    (comp.unix.shell)