shell 腳步統計自身執行次數

#!/bin/bash

if [ -e a.txt ]

then

        n=$(cat a.txt)

else

        n=0

fi


if expr $1 + 0 &>/dev/null

then

        echo  "$1 is number"

        n=0

else

        echo "$1 is not number please input number"     

fi


let n++

echo $n > a.txt

cat a.txt


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章