Re: [CentOS] how to separate individual logs?

2010-12-04 Thread hadi motamedi
On 12/1/10, John Doe jd...@yahoo.com wrote: I copy/pasted the code above and it works fine... If I indent it like mine, they are identical. Check that ftp does not add control chars. You run it with bash, right? Ask your sysadmin/colegue to help you. JD Sorry to forget to mention that your

Re: [CentOS] how to separate individual logs?

2010-12-03 Thread John Doe
From: Les Mikesell lesmikes...@gmail.com If the first line of the input file used doesn't match the pattern you'd probably get an error in the redirect since $LOGFILE would not be set. If the data file does not respect the order section+body... he could just add a LOGFILE=garbage.txt at

Re: [CentOS] how to separate individual logs?

2010-12-01 Thread John Doe
From: hadi motamedi motamed...@gmail.com I even tried to make it as an script file and made it executable but still getting the following error: 'syntax error near unexpected token 'done' Ok, last try... Did you copy/pasted my code? Did you type it? Saying just that there's a syntax error

Re: [CentOS] how to separate individual logs?

2010-12-01 Thread hadi motamedi
On 12/1/10, John Doe jd...@yahoo.com wrote: Ok, last try... Did you copy/pasted my code? Did you type it? Saying just that there's a syntax error without showing the code you used does not help... JD Please find below the code that I tried : cat Edit3 | tr -d \r | while read LINE; do

Re: [CentOS] how to separate individual logs?

2010-12-01 Thread hadi motamedi
On 12/1/10, John Doe jd...@yahoo.com wrote: Ok, last try... Did you copy/pasted my code? Did you type it? Saying just that there's a syntax error without showing the code you used does not help... JD Sorry to forget to mention that I have copied your code from your message into a text

Re: [CentOS] how to separate individual logs?

2010-12-01 Thread John Doe
From: hadi motamedi motamed...@gmail.com On 12/1/10, John Doe jd...@yahoo.com wrote: Ok, last try... Did you copy/pasted my code? Did you type it? Saying just that there's a syntax error without showing the code you used does not help... Please find below the code that I tried :

Re: [CentOS] how to separate individual logs?

2010-12-01 Thread Les Mikesell
On 12/1/2010 11:14 AM, John Doe wrote: From: hadi motamedimotamed...@gmail.com On 12/1/10, John Doejd...@yahoo.com wrote: Ok, last try... Did you copy/pasted my code? Did you type it? Saying just that there's a syntax error without showing the code you used does not help... Please

Re: [CentOS] how to separate individual logs?

2010-11-30 Thread hadi motamedi
On 11/30/10, Tony Schreiner tony.schrei...@bc.edu wrote: That error would happen if you did not have a space between [ and $? Tony Schreiner Thank you very much for your help. Actually, I didn't have got a clear understanding of your code. Sorry for my mis-understanding. At now, I analyzed

Re: [CentOS] how to separate individual logs?

2010-11-30 Thread hadi motamedi
On 11/30/10, John Doe jd...@yahoo.com wrote: My pseudo-code does exactly what you described (re-read it)... And it creates MODULE.log files... $ ll -n total 36 -rw-r--r-- 1 2000 500 4678 nov 30 10:49 Edit3 -rw-r--r-- 1 2000 500 39 nov 30 10:54 HLR.log -rw-r--r-- 1 2000 500 2320 nov 30

Re: [CentOS] how to separate individual logs?

2010-11-30 Thread cybernet
can you please tell what that command does ?:)) From: hadi motamedi motamed...@gmail.com To: CentOS mailing list centos@centos.org Sent: Tue, November 30, 2010 6:52:30 AM Subject: Re: [CentOS] how to separate individual logs? On 11/29/10, John Doe jd

Re: [CentOS] how to separate individual logs?

2010-11-30 Thread hadi motamedi
On 11/30/10, cybernet cyberne...@yahoo.com wrote: can you please tell what that command does ?:)) Sorry. Which command do you mean? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos

Re: [CentOS] how to separate individual logs?

2010-11-30 Thread cybernet
Sent: Tue, November 30, 2010 10:16:43 AM Subject: Re: [CentOS] how to separate individual logs? On 11/30/10, cybernet cyberne...@yahoo.com wrote: can you please tell what that command does ?:)) Sorry. Which command do you mean? ___ CentOS mailing list

Re: [CentOS] how to separate individual logs?

2010-11-30 Thread hadi motamedi
On 11/30/10, cybernet cyberne...@yahoo.com wrote: cat edit.txt | 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 As you see in the original text file, each module's log is started

Re: [CentOS] how to separate individual logs?

2010-11-30 Thread John Doe
From: hadi motamedi motamed...@gmail.com On 11/29/10, John Doe jd...@yahoo.com wrote: cat edit.txt | 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 Thank you

Re: [CentOS] how to separate individual logs?

2010-11-30 Thread hadi motamedi
On 11/30/10, John Doe jd...@yahoo.com wrote: The trick is that your original file has '\r' chars lurking around... Forgot I did removed them manualy when I saw them... cat Edit3 | tr -d \r | while read LINE; do Instead of just copy/pasting, try to understand what it does. Here is how it

Re: [CentOS] how to separate individual logs?

2010-11-30 Thread John Doe
From: hadi motamedi motamed...@gmail.com On 11/30/10, John Doe jd...@yahoo.com wrote: The trick is that your original file has '\r' chars lurking around... Forgot I did removed them manualy when I saw them... cat Edit3 | tr -d \r | while read LINE; do Instead of just copy/pasting,

Re: [CentOS] how to separate individual logs?

2010-11-30 Thread Tony Schreiner
On Nov 30, 2010, at 4:07 AM, hadi motamedi wrote: On 11/30/10, cybernet cyberne...@yahoo.com wrote: cat edit.txt | 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 As you see in the

Re: [CentOS] how to separate individual logs?

2010-11-29 Thread John Doe
From: hadi motamedi motamed...@gmail.com I have captured a file in my centos showing logs captured from many modules concurrently. Please find attached a sample of the file. As you see, there are logs from individual modules that have been captured concurrently. For example, there are

Re: [CentOS] how to separate individual logs?

2010-11-29 Thread Raj kumar
Please unsubscribe the side on my email -Original Message- From: centos-boun...@centos.org [mailto:centos-boun...@centos.org] On Behalf Of John Doe Sent: 29 November 2010 16:50 To: CentOS mailing list Subject: Re: [CentOS] how to separate individual logs? From: hadi motamedi motamed

Re: [CentOS] how to separate individual logs?

2010-11-29 Thread hadi motamedi
On 11/29/10, John Doe jd...@yahoo.com wrote: Here is The Power of CentOS!!! (in approximately 3 minutes...) cat edit.txt | 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

[CentOS] how to separate individual logs?

2010-11-28 Thread hadi motamedi
Dear All I have captured a file in my centos showing logs captured from many modules concurrently. Please find attached a sample of the file. As you see, there are logs from individual modules that have been captured concurrently. For example, there are logs from IPTR,SNMP,HLR,TCAP,XAPP,and SCCP

Re: [CentOS] how to separate individual logs?

2010-11-28 Thread Fajar Priyanto
On Mon, Nov 29, 2010 at 2:58 PM, hadi motamedi motamed...@gmail.com wrote: Dear All I have captured a file  in my centos showing logs captured from many modules concurrently. Please find attached a sample of the file. As you see, there are logs from individual modules that have been captured