[問題] 請問使用AWK出現的錯誤訊息
下面是我的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
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 3 篇):
Linux 近期熱門文章
23
129
PTT數位生活區 即時熱門文章