I get a syntax error:
/usr/xpg4/bin/awk: file "./test.awk": line 64: syntax error
Context is:
>>> printf (", %s", date_value ( $3, fmt_yyyymmdd ) ); <<<
The code fragments are:
fmt_yyyymmdd="yyyymmdd";
printf (", %s", date_value ($22, fmt_yyyymmdd ) );
...
function date_value(string, format)
{
return "20150101";
}
I am not able to understand where the syntax error is. A very similar statement (with one parameter only) produces no syntax error and works correctly.
printf (", %s", char_value ( $2) );
For me it seems that awk either does not allow calling a user defined function with a parameter being a user defined variable or literal or calling a user defined function with more than one parameter. I am unfortunately not proficient in awk.
printfinside of an action?