shanenin Posted July 30, 2005 Report Share Posted July 30, 2005 I was reading in my book that the bourne shell, sh, only supports scalar varaible, not arrays. I would expect the following to fail, but it works well#!/bin/shVAR=(aaa bbb)echo ${VAR[1]}isn't the above code a array variable, if so it should not work? Quote Link to post Share on other sites
shanenin Posted July 30, 2005 Author Report Share Posted July 30, 2005 I found this explanation. Only where bash and POSIX sh are incompatible, will /bin/bash interperet the code in a strict POSIX sh manner. That would explain why #!/bin/sh would run the code above. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.