作者MOONRAKER.bbs@ptt.cc (㊣烏笨禿,又笨又禿) 看板: linux
標題Re: [問題] egrep+awk後,如何在每一列自行加 西元 …
時間批踢踢實業 (2008/05/11 Sun 15:58:56)
※ 引述《seedbcc (志明)》之銘言:
: LOG_DATE=`date '+%b %e'`
: MSGLOG_FILE='/temp/messages'
: echo -e "<<< LOGON Fail REPORT>>>\n" > $FILE3
: egrep "^$LOG_DATE.*Authentication failure for" $MSGLOG_FILE |awk '{printf "%s
: %s %s, %s\n",$3,$2,$1,$11}' >> $FILE3
: echo -e "<<<End of Logon Fail Report>>>\n" >> $FILE3
[中略]
: 不知道要如何修改上面 egrep 那行
把awk後面那堆改成 '{printf "%s %s %s 2008, %s\n", $3, $2, $1, $11}'
不就結了
: 分行寫會變成如下內容~也不是我想要的
: <<< LOGON Fail REPORT>>>
: 09:31:57 09 May
: 09:31:57 09 May
: 09:31:57 09 May
: 2008,
: test3
: test3
: test5
: <<<End of Logon Fail Report>>>
我倒想知道這是怎麼發生的。
--
Batch 2 update (5/10) - 西班牙宗教審訊 - 主教 - 地獄阿婆 - AND LOTS MORE
Unleashed Pythonesque pleasure, fully l10n'ed for Traditional Chinese
Spam-a-lot and prosper with the Monty Python!
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
■ 蒙帝派松正體中文計畫 ■ http://www.youtube.com/user/JamesBondXD
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.115.217.215