Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a bash script using simple array operations like: testarray=("First Name" "Second Name" "Third Name") ; for i in "${testarray[@]}" ; do echo "$i" ; done

What bash version number came with that original release? 10.4.11 shows me more or less 2.05b.0(1)-release, copyright 2002.

I tested it on my MacOS 10.4.11 and since I saw the 2.05b vrsion, I kinda freaked out since it's very old even for 10.4.11... 10.4.0 is likely sub 2.0. Is my script backward compatible with 10.4.0?

Someone here will probably throw it into a ppc virtual machine or something. It doesn't have to be exactly 10.4.0, but closer is better. I can't tell if Apple's documentation is correct but it has the exact version number in the online manpages :)

share|improve this question
up vote 2 down vote accepted

You can consult to examine the open source components used in the various releases of Mac OS X.

10.4 (.0) included “bash-44.2”; its CHANGES file indicates that it is 2.05b.

10.4.11 on x86 and 10.4.11 on PPC both included “bash-44.5”; CHANGES say it is 2.05b.

The code differences between Apple’s bash-44.2 and -44.5 are very minimal: added volatile to one variable and changed the SIGWINCH handling a bit.

Farther back, 10.2 (.0) included “bash-23”; CHANGES says it is 2.05a.

Bash is not listed as a component of 10.1 or 10.0.

It looks like (according to NEWS) arrays were introduced as a new feature in bash-2.0, so it looks like you are safe back to at least Mac OS X 10.2.

share|improve this answer
+1. Very useful information for now and for me to look at Darwin later. Thanks – Vlueboy Jul 18 '11 at 16:12

I don't have a 10.4.0 system handy; will you settle for 10.3.9? It came with bash version 2.05b.0(1)-release, so I think you're safe.

Edit: I found some of my old notes, and if they're correct version OS X version 10.2.8 came with bash version 2.05a.0(1)-release. So they've been using bash v2 for a while...

Oh, and I tested your array code on 10.3.9 and it worked as expected.

share|improve this answer
+1 for the edit. Thanks – Vlueboy Jul 18 '11 at 16:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .