Skip to main content
deleted 71 characters in body
Source Link
Gilles 'SO- stop being evil'
  • 866.2k
  • 205
  • 1.8k
  • 2.3k

EDIT: according Stéphane Chazelas sh language.

When you use ./scriptname.sh it executes with /bin/bash as in the first line with #! but not with. But when you use sh scriptname.sh it executes sh, not bash.

The Shell havesh shell has no syntax to create arrays, but Bash havehas the syntax you used.

EDIT: according Stéphane Chazelas sh language.

When you use ./scriptname.sh it executes with /bin/bash as in the first line with #! but not with sh.

The Shell have no syntax to create arrays, but Bash have the syntax you used.

When you use ./scriptname.sh it executes with /bin/bash as in the first line with #!. But when you use sh scriptname.sh it executes sh, not bash.

The sh shell has no syntax to create arrays, but Bash has the syntax you used.

According comment
Source Link

EDIT: according Stéphane Chazelas sh language.

When you use ./scriptname.sh it executes with /bin/bash as in the first line with #! but not with sh.

The Shell have no syntax to create arrays through array=(values), array could be created by one element through it index, e.g. array[index]=value. Butbut Bash have the syntax you used.

When you use ./scriptname.sh it executes with /bin/bash as in the first line with #! but not with sh.

The Shell have no syntax to create arrays through array=(values), array could be created by one element through it index, e.g. array[index]=value. But Bash have the syntax you used.

EDIT: according Stéphane Chazelas sh language.

When you use ./scriptname.sh it executes with /bin/bash as in the first line with #! but not with sh.

The Shell have no syntax to create arrays, but Bash have the syntax you used.

Source Link

When you use ./scriptname.sh it executes with /bin/bash as in the first line with #! but not with sh.

The Shell have no syntax to create arrays through array=(values), array could be created by one element through it index, e.g. array[index]=value. But Bash have the syntax you used.