i'm trying to use the "before" output from the match() function as part of the results of each Regex match... but...
My input data: (from an input file)
i only show the first record in my file.. all other records are similar.
mds_ar/bin/uedw92wp.ksh:cat $AI_SQL/wkly_inqry.sql $AI_SQL/wkly_inqry_trtry.sql $AI_SQL/wkly_nb_trtry.sql \
#!/usr/bin/nawk -f
BEGIN {
pat="AI_SQL\/[a-zA-Z_]+\.sql"
}
{
while (match($0, pat)) {
before = substr($0,1,RSTART-1);
pattern = substr($0,RSTART,RLENGTH);
printf("%s%s\n", before, pattern);
$0=substr($0, RSTART+RLENGTH)
}
}
I was expecting to see the "before" in my printf() literaly before "pattern" each time i cycle through the while loop, but i'm only getting it the first time it loops through.. 
Results i'm getting for above code:
mds_ar/bin/uedw92wp.ksh:cat $AI_SQL/wkly_inqry.sql
$AI_SQL/wkly_inqry_trtry.sql
$AI_SQL/wkly_nb_trtry.sql
Results i'm ultimately trying to generate:
mds_ar/bin/uedw92wp.ksh:$AI_SQL/wkly_inqry.sql
mds_ar/bin/uedw92wp.ksh:$Ai_SQL/wkly_inqry_trtry.sql
mds_ar/bin/uedw92wp.ksh:$AI_SQL/wkly_nb_trtry.sql
