Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compound variable assignment

Status
Not open for further replies.

ogniemi

Technical User
Nov 7, 2003
1,041
0
0
PL

Hello,

I am looking for equivalent in ksk88

Code:
$ ksh93
$ Version M-12/28/93e
$ d=(a=1 b=2 c=3)
$ print ${d.c}
3
$


in ksh88 it doesn't work in that way:
Code:
$ Version M-11/16/88f
$ d=(a=1 b=2 c=3)
ksh: 0403-057 Syntax error: `(' is not expected.
 
There is NO associative array in ksh88, sorry.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
interesting...

may I have another question if example above could be used in for loop?

I have checked but it produces an error:

Code:
$ d=(a=1 b=2 c=3)
$ echo ${d.b}
2
$ for i in a b c;do print ${d.[red]$i[/red]};done
ksh93: syntax error: `.' unexpected.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top