-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jim Hyslop wrote: > On a tangent - I'm currently (ahem) `bash`ing my head trying to get > some simple stuff working <Jim ducks to avoid flying objects>. Any > suggestions for getting up to speed with shell programming? What I > need is something that will help me understand subtleties like > scope of variables. For example, in this code snippet:
Not sure what you are bashing your head against here. I thought all shell variables were globals, except the $@ ($1, $2, etc.) arguments set at the entrance of scripts and functions. Period. Of course, you can get apparently smaller scopes by launching subshells, but those are just globals too and you lose access to any previous globals you didn't `export'. I generally launch subshells explicitly (var=$( ... ), or var=` ... ` to gather output), but you probably invoked an implicit subshell by using the pipe. Not sure what references to direct you to. I generally use `info bash` for general issues. There is a really good section in the Autoconf manual on the portability of various shell constructs. I reference it a lot. `info Autoconf', then select the chapter on "Portable Shell" from the main menu. The capital "A" in `info Autoconf' has been important for a few releases. See <http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_chapter/autoconf_10.html#SEC114> for the online version of the chapter in question. Cheers, Derek - -- Derek R. Price CVS Solutions Architect Get CVS support at Ximbiot <http://ximbiot.com>! v: +1 248.835.1260 f: +1 248.835.1263 <mailto:[EMAIL PROTECTED]> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEiE0jLD1OTBfyMaQRAgIZAKDlNdHUc8dWbU5GBrekb9c2edfYtACg+6i1 IxuXL5sjDQJmNTdDbxDDvCQ= =22gO -----END PGP SIGNATURE----- _______________________________________________ Bug-cvs mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/bug-cvs
