작성일 : 16-08-02 10:01
bash syntax
 글쓴이 : 조희승
조회 : 270  
argc=$#
if [ $argc -lt 2 ] ;then
    echo "input parameter"
    exit
fi



if [ "$1" == "" ] ; then
    echo "nmon.sh [time]"
    exit
fi




for (( c=1; c<=5; c++ )); do
echo "Welcome $c times..."
done


for i in {1..5}; do
  echo "Welcome $i times"
done


for i in {0..10..2}; do
    echo "Welcome $i times"
done
 
for i in 200 400 600 800 1000 1200 1400 1600 1800 2000; do
    echo ./matrixMul.arm $i $1
    ./matrixMul.arm $i $1
done



----------------------------------------
ls | awk -F ' ' '{print $4}'

-----------------------------------
peakmem.sh
max=0

sync; echo 3 > /proc/sys/vm/drop_caches; sleep 1; free -o

while [ 1 ]
do

cur=`free | grep Mem: | awk '{print $3}'`
if [ $cur -gt $max ]
then
max=$cur
fi

echo $cur $max
sleep 1

done