awk1.sh
=======
awk BEGIN { FS="|" } FNR==NR { f1[$1]=$2; next } $1 in f1 && $2 =="xx" && $1 == "DAILY_JOB" {print $3}
awk -f awk1.sh a.txt b.txt--Its working fine .
When passing parameters its not working .Any help it should be appereciated.
awk -f awk2.sh xx a.txt b.txt
awk2.sh
=======
param =$1
file1 =$2
file2 =$3
awk BEGIN { FS="|" } FNR==NR { f1[$1]=$2; next } $1 in f1 && $2 =="xx" && $1 == "DAILY_JOB" {print $3} $file1 $file2
syntax error The source line is 1.
The error context is
>>> BEGIN <<<
awk: Quitting
The source line is 1.
d.sh[6]: Syntax error at line 7 : `}' is not expected.