On Wed, 2007-06-27 at 05:02 -0500, Dallas Clement wrote:
> Can anyone please suggest a reference to some good Ash scripting
> documentation?  I am trying to implement scripting like I'm using
> Bourne shell and things are not behaving too well...

Most likely you're actually using bash syntax, not Bourne shell syntax.
Bash has a number of enhancements that are not supported by Bourne shell
(or the POSIX sh standard).  However, because many GNU/Linux
distributions come with bash as /bin/sh, people who are learning shell
scripting on GNU/Linux often make the mistake of thinking bash features
are Bourne shell features.

> In particular, I'm wondering how to correctly define shell script
> functions and call the functions.  I presume this is supported with
> the busybox ash implementation.

Yes, functions are supported.

Since you don't give an example of what you're doing, we'll just have to
guess: I guess you're doing this:

        function myfunc () {
                ...
        }

This is not valid Bourne/POSIX sh syntax.  The "function" keyword is a
bash-ism, and is not needed in Bourne/POSIX sh.  Just write:

        myfunc () {
                ...
        }

If this isn't the problem, please provide a sample of the code you're
using and show us what errors you get when you try it.

Cheers!

-- 
-----------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>                       http://netezza.com
 "Please remain calm--I may be mad, but I am a professional."--Mad Scientist
-----------------------------------------------------------------------------
      These are my opinions--Netezza takes no responsibility for them.
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to