Issue with basic Awk script

Here's a basic awk program I am trying to run. It shows no error but shows no result either too. If someone can look up and tell me what's wrong I will be obliged.

Thanks. :slight_smile:

Code Snippet.

#!/bin/bash
 awk '{
     for (i = 1 ; i <= 3 ; i++)
             for ( j = 1 ; j <= 3 ; j++ ) {
                     a[i,j] = 9
         }
 }
 
 END {
     for ( i = 1 ; i <= 3 ; i++ )
             for ( j = 1 ; j <= 3 ; j++ )
                     printf(" %s ", a[i,j])
 }'

You don't show us what output you're expecting,
do you want something like this?

zsh-4.3.12[t]% awk 'BEGIN {
  for (i = 1; i <= 3; i++)
    for (j = 1; j <= 3; j++)
      a[i,j] = 9

  for (i = 1; i <= 3; i++)
    for (j = 1; j <= 3; j++)
      printf " %s ", a[i,j]
}'
 9  9  9  9  9  9  9  9  9 %    

Thanks Radoulov. That's what I need. I will now build on this my actual proble.

Thank You. :slight_smile: