Could someone give me an example of awk accessing array defined in Korn Shell?

As per title and much apprecieated!

Please modify the example

awk '{
key=substr($0,1,10)
key1=substr($0,1,21)
if(arr[key])
{

            arr[key]=1
       \}
   else
        \{
             arr[key]=$0
        \}
\}
END \{for \(i in arr\) \{print arr[i]\} \} '  file_name

dhanamurthy, thank you for your reply, but could you please specify how the array name "arr" was defined outside of awk snippet (in shell)?

and the $0 means every line from the file? so your statement key=substr($0,1,10) means the 1-10 characters of the lines in the file, but you use it like this arr[key], sorry I do not understand.