次のようなテキストの場合:
std_out_file: ${ALGO_TOP}/dynamic/batchlog/JS030003-ara.stop.badb.out
出力を次のようにしたい:
$BATCHLOG_DIR/JS030003-ara.stop.badb.out
コードは次のとおりです。
nawk '/std_out_file:|std_err_file:/ { split($2, a, /); if ( a[3]=="batchlog" ) print "$$BATCHLOG_DIR/"$3; else print "$$CONSOLELOG_DIR/"$3; }'
次のエラーが発生しました。
nawk: illegal primary in regular expression ); if ( a[3]=="batchlog" ) print "$$BATCHLOG_DIR at ; if ( a[3]=="batchlog" ) print "$$BATCHLOG_DIR
source line number 4
context is
/std_out_file:|std_err_file:/ { split($2, a, /); if ( a[3]=="batchlog" ) print "$$BATCHLOG_DIR/", $3; else print >>> " <<<
どこで間違えたの?