[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

please correct me on my code?



Dear All
On my Debian server, I need to separate the individual logs coming
from various modules concurrently. Please find below a sample of the
logs:
' IPTR >..

Read Subscript: 153 Write Subscript: 154 Port: 4972
Current time: Tue Nov 23 15:33:53 2010
Sent packet to 172.18.99.1 4972 #0
packet is 1081 bytes long, contains:
30 82 04 35 02 01 01 04 06 70 75 62 6C 69 63 A7 82 04 26 02 01 01 02
01 FF 02 0107 30 82 04 19 30 82 04 15 06 0F 2B 06 01 04 01 8A 5D 01 03
03 04 02 07 AE 0B 0482 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00

SNMP >..

local:4972 ==> 172.18.99.1:4972 Type=Trap-V2, RID=136337360,
Error=255, Bind=1
oid[0]=1.3.6.1.4.1.1373.1.3.3.4.2.7.5899, vartype=04, msglen=1024

local:4969 ==> 172.18.99.1:4969 Type=Trap-V2, RID=1, Error=80, Bind=1
oid[0]=1.3.6.1.4.1.1373.1.3.3.8.2.7.779, vartype=04, msglen=1024

HLR >..

HLR recv <- DELIM ind
Dialogue id:1927'
As you see, each log begins with its modules name that I need to
separate its individual log. So I have wrote the following code to
separate it:
#cat Edit3 | tr -d "\r" | while read LINE; do
>echo "$LINE" | grep -q '>\.\.'
>if [ $? -eq 0 ]; then
>LOGFILE=`echo $LINE | cut -d' ' -f1`.log
>else
>echo "$LINE" >> $LOGFILE
>fi
>done
But when I run it, I am receiving the following error:
-bash: -f1.log : command not found
-bash: $LOGFILE : ambiguous redirect
Can you please help me to correct my code?
Thank you


Reply to: