#!/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
#!/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