PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : چراارور میده



Woshka
March 1st, 2010, 18:18
چرا این ارور میده؟



root@box01 [/usr/local/apache/logs]# for x in 'grep .file does not exist. Error_log | awk '{print $13}' | sort | uniq'; do \
> echo -n "$x : "; grep $x error_log | wc -l; done
grep .file does not exist. Error_log | awk {print : Grep: .file: No such file or directory
grep: Does: No such file or directory
grep: Not: No such file or directory
grep: Exist.: No such file or directory
grep: |: No such file or directory
grep: Awk: No such file or directory
grep: {print: No such file or directory
0
3} | sort | uniq : Grep: |: No such file or directory
grep: Sort: No such file or directory
grep: |: No such file or directory
grep: Uniq: No such file or directory
0
root@box01 [/usr/local/apache/logs]#


---------- Post added at 06:18 PM ---------- Previous post was at 05:30 PM ----------

[وابو جای دیگه گرفتم



i think you need to use backticks rather than speach. Try the following

for x in `grep ".file does not exist." error_log | awk '{print $13}' | sort | uniq` ; do
echo -n "$x :" ; grep $x error_log | wc -l
done

you might find the following neater/easier to understand


grep ".file does not exist." error_log | awk '{print $13}' | sort -u | while read x ; do
echo -n "$x :" ; grep -c $x error_log
done

you also add in xargs but i've not had time to test that

Vahid
March 1st, 2010, 21:05
میخوای چی کار کنی؟