index | submit | rank | book

run-count – Counting program runs

Write a program that prints how many times it has been run by means of a runcount.txt file like so:

$ ./run-count
run #1
$ ./run-count
run #2
$ ./run-count
run #3

If it is the first time your program is running in the working directory, a runcount.txt file should be created with the number 1 and your program should print run #1. Each time your program is run, the number n in the runcount.txt file should be incremented and your program should print run #n.

Scoring

try first: file-write file-read

try next: hello-cmd erro

index | submit | rank | book

Copyright © 2020-2021 Rudy Matela
All rights reserved