embarrassing question: is sh = bash ?

I would like to know the version of my shell. I usually type "sh scriptName".

I googled for it and they usually say bash --version.
But is the same shell ? Can I have installed multiple shells ?

thanks

Shell (computing) - Wikipedia, the free encyclopedia

ok thanks, I have now better question...

i have a small problem in scanning an array in a for loop.

I know how to access to a single cell: $magnaPlaza[$1];

but how can I write the indexing variable in a for loop ?

for j in `seq 3`
do
echo referenceImage $magnaPlaza[$j];    --> this doesn't work

echo referenceImage $magnaPlaza[$$j];    --> this doesn't work

I need somehow to pass the value of j but keep the $ symbol in front of it...

thanks

The way to access an element in an array:

echo "${magnaPlaza[$j]}"

thanks.. however, your line gives me the following error:

scriptAlign: 26: Bad substitution

thanks

How do you assign the values to the array and how does your loop look like?

Post a snippet of your script.

nevermind, I found another solution:

thanks anyway

This should work:

magnaPlaza=( place1 place2 place3 )
for j in `seq 0 2`
do
   echo "${magnaPlaza[j]}"
done

Cheers,
Loic.