- 追加された行はこの色です。
- 削除された行はこの色です。
***Headers.logをJSTで [#m1083926]
ircddbgateway+gmsrepeater等で吐き出される/var/log/Headers.logの時刻表示がUTCに
なっているので、JST表示にした。
+hlog.sh
#!/bin/sh
LOGF="/var/log/Headers.log"
DT0=`tail -5 $LOGF | head -1 | cut -b1-19`
while :
do
LOG1=`tail -1 $LOGF`
DT1=`echo "$LOG1" | cut -b1-19`
DTN=`grep -n "$DT0" $LOGF | cut -d":" -f1 | tail -1`
DTALL=`wc -l $LOGF | cut -d" " -f1`
FLAG=`expr $DTALL - $DTN`
if test "$FLAG" = "" ; then
FLAG="0"
fi
#echo "DT0=[$DT0] LOGF=[$LOGF] LOG1=[$LOG1]"
#echo "DT1=[$DT1] DTN=[$DTN] DTALL=[$DTALL] FLAG=[$FLAG]"
tail -$FLAG $LOGF > temp1.txt
while read line
do
DTUTC=`echo "$line" | cut -b1-19`
MSG0=`echo "$line" | cut -d " " -f6-`
DTTEMP=`date +%s --date "$DTUTC"`
DTJST=`expr $DTTEMP + "32400"`
DTJST=`date --date "@$DTJST" | cut -b30-46`
echo "$DTJST:$MSG0"
done <temp1.txt
DT0="$DT1"
sleep 5
done
#clear
#comment
#navi(日記)