Hi,
I need do some calculate in awk script, then pass the values out. For example,
#!/bin/bash
cat example.txt | awk -v T_C=$TC T_V=$TV '{
if( $0 ! /^ABC/ ){
T_C=T_C+1;
}
if( $0 ! /^XYZ/ ){
T_V=T_V+1;
}
}'
echo $TC
echo $TV
How could I pass the values of T_C and T_V out to my shell script?
Thanks.
I need do some calculate in awk script, then pass the values out. For example,
#!/bin/bash
cat example.txt | awk -v T_C=$TC T_V=$TV '{
if( $0 ! /^ABC/ ){
T_C=T_C+1;
}
if( $0 ! /^XYZ/ ){
T_V=T_V+1;
}
}'
echo $TC
echo $TV
How could I pass the values of T_C and T_V out to my shell script?
Thanks.