home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung 2
/
Power-Programmierung CD 2 (Tewi)(1994).iso
/
c
/
compcomp
/
awk
/
array.awk
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1990-02-07
|
248 b
|
8 lines
# demonstrate set operations on an array
$1 == "IN" { if ($2 in a) print $2, a[$2]; else print $2, "is not in a"; next}
$1 == "DEL" { delete a[$2]; next }
$0 == "ALL" { for (i in a) printf("a[%s] = %s\n", i, a[i]) }
NF == 2 { a[$1] = $2 }