Lets say you have a file called REVISION which contains a single number. If you want to increment the number in that file you could run the following command:
Wrap that up as a nice shell script and you get a nice increment command:
[nathan@nate ~]$ cat REVISION
1
[nathan@nate ~]$ increment REVISION
[nathan@nate ~]$ cat REVISION
2
No Comments, Comment or Ping
Reply to “increment the number in a file”