06-28-2006
8,
0
Join Date: Jun 2006
Last Activity: 5 June 2008, 11:18 AM EDT
Posts: 8
Thanks Given: 0
Thanked 0 Times in 0 Posts
Thanks for your quick response matrix.
I am sorry. I modified, but still I am getting the below error.
First line of script is working and also the second line.
But it seems the issue with the 3rd line.
Syntax Error The source line is 1.
The error context is
BEGIN{} { if(NR > >>> 1 <<<
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
awk: 0602-540 There is a missing } character.
awk: 0602-540 There is a missing ) character.
server_elapsed= 0.999 | server_elapsed= 0.999 |
The script I am using is inp.sh
firststring=`awk -F"=" '/server_elapsed/ { if( $7 > 0.100 ) { print "server_elapsed="$7"|"} }' inp`
val=`awk -F"=" '/server_elapsed/ { if( $7 > 0.100 ) { print NR } }' inp`
echo $firststring`awk -F"=" 'BEGIN{} { if(NR > '$val' && $0 !~ /^;/ ) { printf $0" " } } END{ printf ";" }' inp`
The input file : inp
-- appl = host = user = / pid = 76 elapsed = 0.000 seconds server_elapsed = 0.999
select emp_no, dept_no
from dept
where deptname like 'IT%'
;
-- appl = host = user = / pid = 76 elapsed = 0.000 seconds server_elapsed = 0.999
select emp_no, dept_no
from dept
where deptname like 'IT%'
and empid=100
;