shell 腳步統計自身執行次數

#!/bin/bashbash

if [ -e a.txt ]ide

theninput

        n=$(cat a.txt)it

elseclass

        n=0di

fiview


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

thenco

        echo  "$1 is number"editor

        n=0

else

        echo "$1 is not number please input number"     

fi


let n++

echo $n > a.txt

cat a.txt

相關文章
相關標籤/搜索