Hi
code is modifed,output is not coming
[HTML]
root@blr-svr-oclan-01 # more script.awk
BEGIN {print "IP HOST_NAME SUB "}
/IP IS/ {IP=$3}
/.local.|#cont/ {HOST=$1;sub(/\[[^\]]*\]/,"",HOST);sub(/#.*/,"",HOST)}
/PPPoE/ {SUB=$3 ;print IP, HOST, SUB}
HTML Code:
root@blr-svr-oclan-01 # /usr/xpg4/bin/awk -f script.awk /Scripts/sub_report.txt
HTML Code:
IP HOST_NAME SUB
10.238.52.65 [local]pun-ras-bng-mhs-01 13623
10.238.54.1 [local]enk-ras-bng-cse-01 19610
10.238.56.225 [local]ngp-ras-bng-cto-01 19090
output is like below
if iam using only awk ,then output is like below
HTML Code:
root@blr-svr-oclan-01 # awk -f script.awk /path/to/Scripts/sub_report.txt
awk: syntax error near line 3
awk: illegal statement near line 3
awk: syntax error near line 3
awk: illegal statement near line 3
awk: illegal statement near line 4
root@blr-svr-oclan-01 #