i think.....
it's possible use a variable out a awk in the awk ???
ex.
A=20071225
awk '{ print "the value is" $a }'
OR
awk '{ print "........"; c=10; print $c ; c=$A ; print $A}'
for a external variable is possbile use in the awk ???
i think.....
it's possible use a variable out a awk in the awk ???
ex.
A=20071225
awk '{ print "the value is" $a }'
OR
awk '{ print "........"; c=10; print $c ; c=$A ; print $A}'
for a external variable is possbile use in the awk ???
You can do :
A=20071225
awk '{ print "the value of A is" '"$A"' }' infile
Or
A=20071225
awk -v A="$A" '{ print "........"; c=10; print $c ; c=A ; print A}' infile
or
A=20071225
awk '{ print "........"; c=10; print $c ; c=A ; print A}' A="$A" infile
or
export A=20071225
awk '{ c=ENVIRON["A"] + $1; print c}' infile