Hello,
I have a .sh script that grep's a text file, when the result is returned, its all mixed in together in one line:
07/25/2007,20:40:42,jubileeNT,Start,9999999999@mb.next.co.ke,200,9999999999@mb.next.co.ke,199.251.23.76,35406,199.21532.161,000009999999999,server-03-PCSCLN03,1,,,,,,,,,,,1185396042,,416565070091,16H9zrig,16H9z2JF,59,,, 07/25/2007,20:40:43,jubileeNT,Stop,9999999999@mb.next.co.ke,200,9999999999@mb.next.co.ke,199.251.23.76,35406,199.21532.161,000009999999999,server-03-PCSCLN03,2,0,0,0,1,,,,,,,1185396043,,416565070091,16H9zrig,16H9z2JF,59,0,0,
When i run the script manually, it looks fine, it may look the same when i pasted it below, but actually the each date stamp is on a new line, whereas in teh above its all together
07/25/2007,20:40:42,jubileeNT,Start,9999999999@mb.next.co.ke,200,9999999999@mb.next.co.ke,199.251.23.76,35406,199.21532.161,000009999999999,server-03-PCSCLN03,1,,,,,,,,,,,1185396042,,416565070091,16H9zrig,16H9z2JF,59,,,
07/25/2007,20:40:43,jubileeNT,Stop,9999999999@mb.next.co.ke,200,9999999999@mb.next.co.ke,199.251.23.76,35406,199.21532.161,000009999999999,server-03-PCSCLN03,2,0,0,0,1,,,,,,,1185396043,,416565070091,16H9zrig,16H9z2JF,59,0,0,
Does anyone have any ideas, please see script below:
#!/bin/sh
clear
echo ""
echo "Command Usage: ./y.sh <MIN> <yyyymmdd>"
echo "Please Select An Option"
echo ""
echo "1) for Eastern - Auth"
echo "2) for Eastern - Acct"
echo "3) for Western - Auth"
echo "4) for Western - Acct"
echo ""
echo "Select: \c"
read ans
case $ans in
'1')
echo `/usr/bin/zcat /elog/pcs1/app/$2*.log.Z | grep $1`
echo `/usr/bin/zcat /elog/pcs2/app/$2*.log.Z | grep $1`
;;
'2')
echo `grep $1 /elog/pcs1/app/$2.act`
echo `grep $1 /elog/pcs2/app/$2.act`
;;
'3')
echo `grep $1 /wlog/pcs1/app/$2*.log`
echo `grep $1 /wlog/pcs2/app/$2*.log`
;;
'4')
echo `grep $1 /wlog/pcs1/app/$2.act`
echo `grep $1 /wlog/pcs2/app/$2.act`
;;
*)
echo "Searching for:" $S_FILTER
esac
Thanks,
dR
I have a .sh script that grep's a text file, when the result is returned, its all mixed in together in one line:
07/25/2007,20:40:42,jubileeNT,Start,9999999999@mb.next.co.ke,200,9999999999@mb.next.co.ke,199.251.23.76,35406,199.21532.161,000009999999999,server-03-PCSCLN03,1,,,,,,,,,,,1185396042,,416565070091,16H9zrig,16H9z2JF,59,,, 07/25/2007,20:40:43,jubileeNT,Stop,9999999999@mb.next.co.ke,200,9999999999@mb.next.co.ke,199.251.23.76,35406,199.21532.161,000009999999999,server-03-PCSCLN03,2,0,0,0,1,,,,,,,1185396043,,416565070091,16H9zrig,16H9z2JF,59,0,0,
When i run the script manually, it looks fine, it may look the same when i pasted it below, but actually the each date stamp is on a new line, whereas in teh above its all together
07/25/2007,20:40:42,jubileeNT,Start,9999999999@mb.next.co.ke,200,9999999999@mb.next.co.ke,199.251.23.76,35406,199.21532.161,000009999999999,server-03-PCSCLN03,1,,,,,,,,,,,1185396042,,416565070091,16H9zrig,16H9z2JF,59,,,
07/25/2007,20:40:43,jubileeNT,Stop,9999999999@mb.next.co.ke,200,9999999999@mb.next.co.ke,199.251.23.76,35406,199.21532.161,000009999999999,server-03-PCSCLN03,2,0,0,0,1,,,,,,,1185396043,,416565070091,16H9zrig,16H9z2JF,59,0,0,
Does anyone have any ideas, please see script below:
#!/bin/sh
clear
echo ""
echo "Command Usage: ./y.sh <MIN> <yyyymmdd>"
echo "Please Select An Option"
echo ""
echo "1) for Eastern - Auth"
echo "2) for Eastern - Acct"
echo "3) for Western - Auth"
echo "4) for Western - Acct"
echo ""
echo "Select: \c"
read ans
case $ans in
'1')
echo `/usr/bin/zcat /elog/pcs1/app/$2*.log.Z | grep $1`
echo `/usr/bin/zcat /elog/pcs2/app/$2*.log.Z | grep $1`
;;
'2')
echo `grep $1 /elog/pcs1/app/$2.act`
echo `grep $1 /elog/pcs2/app/$2.act`
;;
'3')
echo `grep $1 /wlog/pcs1/app/$2*.log`
echo `grep $1 /wlog/pcs2/app/$2*.log`
;;
'4')
echo `grep $1 /wlog/pcs1/app/$2.act`
echo `grep $1 /wlog/pcs2/app/$2.act`
;;
*)
echo "Searching for:" $S_FILTER
esac
Thanks,
dR