1. 统计的对象words.txt,每个单词占一行(从简考虑了~) zjd@ubuntu:~/test$ cat word.txt used this count mysql count this used mysql linux this redis apple android redis apple 2. 统计每个单词的频率 方法1: zjd@ubuntu:~/test$ cat word.txt |awk '{a[$0]++}END{for(i in a) print i"="
mdate=`date +%R-%d-%m-%Y` LogFile=/root/HDstatusLog.log echo disk is good! $mdate >> $LogFile 输出: disk is good! :--- disk is good! :--- disk is good! :--- 注意: 1. >写入,覆盖掉原有的: >>继续添加,原来的还存在.
#! /bin/bash array=( ... ) var1= var2= ;i<=;i++)); do array[i]="$( cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw )" # echo ${array[i]} " ] then " ] then let var1=var1+ fi fi " ] then " ] then let var2=var2+ fi fi s