[問題] 請問使用AWK出現的錯誤訊息

看板Linux作者 (志明)時間16年前 (2008/05/31 23:04), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/3 (看更多)
下面是我的Script #!/bin/bash YR=`date +%Y` LOG_DATE=`date '+%b %e'` su_file='/export/home/w123/sulog' sudo_file='/export/home/w123/sudo' PATH=$PATH:/usr/sbin:/bin #FILE1:SU Report FILE1=/export/home/wsca123/uxtest_su.txt rm $FILE1 echo " Daily Security Report for `hostname` $NOW " >> $FILE #1:SU Report echo -e "<<< SU REPORT >>>" > $FILE1 echo -e "DateTime, User,/tSu to:" >> $FILE1 egrep "SU" /export/home/w123/sulog|awk -v YR=$YR '{printf "%s %2s %s %s, %s,%s\n",$3,$2,$1,YR,$8,$7 }'|sort -u >> $FILE1 echo -e "<<< End of SU Report >>>\n" >> $FILE1 底下是執行的錯誤訊息 awk: syntax error near line 1 awk: bailing out near line 1 awk: syntax error near line 1 awk: bailing out near line 1 awk: syntax error near line 1 awk: bailing out near line 1 awk: syntax error near line 1 awk: bailing out near line 1 awk: syntax error near line 1 awk: bailing out near line 1 awk: syntax error near line 1 awk: bailing out near line 1 awk: syntax error near line 1 不太清楚是因為 unix跟linux對awk所支援的語法不同嗎 在linux是ok的 但在unix就會有錯誤訊息 ... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.192.229.131
文章代碼(AID): #18GMZ_mY (Linux)
文章代碼(AID): #18GMZ_mY (Linux)