Login
Immutable PageDiscussionInfoAttachments
Diff for "iz/Memo/UnixSeminar2013演習の回答"

MMA
Differences between revisions 9 and 10
Revision 9 as of 2013-05-17 20:50:17
Size: 1621
Editor: iz
Comment:
Revision 10 as of 2013-05-18 00:02:54
Size: 1821
Editor: iz
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 66: Line 65:
c=0
for mail in /ml/mma-active/article/2013_Apl/*.gz
do
  if zgrep nomeaning $mail > /dev/null
  then
    c=`expr $c + 1`
  fi
done
echo $c
}}}

ytokuさんに撃墜されたコード
{{{

fileの中身

cat ~nomeaning/Public/unix-seminar/file.txt

find the keyword

find ~nomeaning/Public/unix-seminar/k/ -type f -name '*keyword*'

grep the keyword

find ~nomeaning/Public/unix-seminar/k/ -type f | xargs grep Keyword

Kernel version

uname -r 

wc

grep a\\.out ~nomeaning/Public/unix-seminar/file2.txt | wc -l

md5sum

md5sum ~nomeaning/Public/unix-seminar/file.txt  

long file

head -12345321 ~nomeaning/Public/unix-seminar/lf.txt | tail -1

Send the signal

cp ~nomeaning/Public/unix-seminar/a.out a.out && ./a.out &

killall -SIGUSR1 a.out

Languages

for lang in c cc cpp rb py hs java
do
    echo $lang
    find ~nomeaning/Public/unix-seminar/langs/ -type f -name \*\.$lang | xargs cat | wc -l
done

最初間違った物を上げていた。szhideとmizunashiに撃墜されたコードがこちら。

for lang in c cc cpp rb py hs java
do
    echo $lang
    find ~nomeaning/Public/unix-seminar/langs/ -type f -name \*\.$lang | xargs wc -l | tail -1
done

Active!

c=0
for mail in /ml/mma-active/article/2013_Apl/*.gz 
do
  if zgrep nomeaning $mail > /dev/null
  then
    c=`expr $c + 1`
  fi
done
echo $c

ytokuさんに撃墜されたコード

zgrep nomeaning /ml/mma-active/article/2013_Apl/*.gz | wc -l

Mailer

zcat /ml/mma-active/article/2012_*/*.gz | grep -E \^\(X-Mailer\|User-Agent\) | cut -d ' ' -f 2 | ruby -e 'hist = Hash.new(0); STDIN.read.split("\n").each{|mailer| hist[mailer] += 1}; hist.each {|k, v| puts "#{k} #{v}"}' | sort -rn -k2

"sort | uniq -c"で出現頻度とれたらしい(ytokuさんより)。Rubyいらなかった。

iz/Memo/UnixSeminar2013演習の回答 (last edited 2013-05-18 00:15:32 by iz)