p*********9 发帖数: 277 | 1 myname[0]="zera"
myname[1]="beta"
总说
myname[0]=zera: not found
myname[1]=beta: not found
怎么回事情呢?
谢谢 |
d*b 发帖数: 21830 | 2 sigh, myname[0].c_str()
【在 p*********9 的大作中提到】 : myname[0]="zera" : myname[1]="beta" : 总说 : myname[0]=zera: not found : myname[1]=beta: not found : 怎么回事情呢? : 谢谢
|
p*********9 发帖数: 277 | 3 dsb, thanks for your reply. It is not working.I tried another three
approaches:
names=( Jennifer Tonya Anna Sadie )
names=( "John Smith" "Jane Doe" )
colors[0] = red
colors[3] = green
colors[4] = blue
None of them works. My system is ubuntu 9.10 Karmic Koala. Probably
something wrong with my settings in the shell. I cannot figure it out. |
p*********9 发帖数: 277 | 4 I solve the problem. I used the wrong shell version.
I originally used #!/bin/sh. It works on a lot of stuff.
After I changed it to #!/bin/bash. the problem with array disappeared. |
X*V 发帖数: 1431 | 5 it is not C++
【在 d*b 的大作中提到】 : sigh, myname[0].c_str()
|