Re: how to separate individual logs?

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



On Nov 30, 2010, at 4:07 AM, hadi motamedi wrote:

> On 11/30/10, cybernet <cybernet2u@xxxxxxxxx> 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
> with the module's name following with '>..' characters so the code is
> expected to search for the start of each module's log and try to
> separate its specific log. I tried for the code but it seems that it
> has some syntax error that needs to be corrected.
> _______________________________________________


That error would happen if you did not have a space between  [ and $?

Tony Schreiner

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux