shell脚本

2017-04-28  本文已影响16人  阳春是你
for i in `ll kmeans |awk '{print $9}' `
cat kmeans/$i | awk '{printf $1" " }'|awk '{print $0}' |awk '{print $0"\n"}'>> result.txt
awk '{i=1; while(i<=NF){print $i; i++ } ;}' clusterd.txt
cat intent_recognition.txt|awk '{gsub(/{|}|:|"|a|b|e|s|,/,"",$0) ;print $0}'
cat keyword_datum.txt |awk '{ if (NF != 0) {printf $1",";printf $2" "} else print ""}'
1、打印不换行:使用printf
2、if else 结构:多条语句用大括号包起来,单条语句直接写
 awk '{if(NF>1 ){print $0"\n"}  }' result.txt > r2.txt
cat click_data.csv | awk -F',' '{print $1}' | uniq -c
sort -t' ' -n -k2 click_number.csv
awk '{cmd="redis-cli --raw SADD se:cluster ""\""$0"\"";system(cmd)}' clusterd.txt
 cat log |grep -E ERROR|awk -F'\\] \\[' '{print $2}'|sort |uniq
sudo cat app_20881.log |grep -E ERROR|awk -F'\\] \\[' '{print $2 }'|sort|uniq |awk '{cmd="cat app_20881.log|grep '\''''"$0"'\'' |wc -l";system(echo cmd)}'
sudo cat app_20881.log |grep -E ERROR|awk -F'\\] \\[' '{print $2 }'|sort|uniq |awk '{print $0}'


awk '{cmd="cat app_20881.log|grep '\''''"$0"'\'' |wc -l";system(cmd)}'

cat app_20881.log|grep "org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver] - Failed to invoke @ExceptionHandler method: public com.dmall.bigdata.domain.Result<java.util.Map<java.lang.String, java.lang.Object>> com.dmall.api.searchengine.AppConfiguration$GlobalExceptionHandler.handleException(java.lang.Exception)"|wc -l

for i in {1..500}; do curl -o /dev/null -s -w %{time_total}"\n" "http://192.168.2.136:8080/jian_so?w=java%E6%95%99%E7%A8%8B" ; done

cat intent_recognition.txt|awk '{gsub(/{|}|:|"|a|b|e|s|,/,"",$0) ;print $0}'
上一篇 下一篇

猜你喜欢

热点阅读