I'm writing an basic bash script where I'm reading a file which contains initially "1" as content. After reading it I want to increase it +1 everytime whenever I run the script.
Example file: 1.txt
1
Initial Content: 1
Expected output when run first time: 1.txt
2
Here is my script
#!/misc/acc-archive/util/bash
i=$(<1.txt)
echo "$1"
j=$((i+=1))
echo "$1"
find . -exec perl -pi -e 's/$1/$j/g' 1.txt \;