Here's a cheesy example from Advanced Bash Scripting Guide

Gedit hightlights both the same even though the array syntax is illegal
in normal Bourne shell (sh) programming.

Here are the results:

[EMAIL PROTECTED]:~/Projects$ ./bash_arrays.sh
area[11] = 23
area[13] = 37
Contents of area[51] are UFOs.
area[43] = 
(area[43] unassigned)

area[5] = area[11] + area[13]
area[5] = 60
expr: non-numeric argument
area[6] = area[11] + area[51]
area[6] = 


area2[0] = zero
area2[1] = one


area3[17] = seventeen
area3[24] = twenty-four
[EMAIL PROTECTED]:~/Projects$ ./sh_arrays.sh
./sh_arrays.sh: 4: area[11]=23: not found
./sh_arrays.sh: 5: area[13]=37: not found
./sh_arrays.sh: 6: area[51]=UFOs: not found
area[11] = ./sh_arrays.sh: 17: Syntax error: Bad substitution


** Attachment added: "sh_arrays.sh"
   http://launchpadlibrarian.net/12344708/sh_arrays.sh

-- 
'sh' syntax highlighting actually for bash, and uses syntax invalid for Bourne 
shell
https://bugs.launchpad.net/bugs/196785
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to