Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 2 down vote accepted

You can consult www.opensource.apple.com 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.