O'Reilly logo

Hands-On System Programming with Linux by Kaiwan N Billimoria

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A few trial runs

When we simply run the program without passing any parameters, the help screen is displayed:

$ ./runwalk_timer Usage: ./runwalk_timer Run-for[sec] Walk-for[sec] [verbosity-level=0|[1]|2] Verbosity Level :: 0 = OFF [1 = LOW] 2 = HIGH$ 

As can be seen, the program expects a minimum of two parameters:

  • The time to run (in seconds) [required] 
  •  The time to walk (in seconds) [required]
  •  The verbosity level [optional]

The optional third parameter, the verbosity level, allows the user to request more or less information as the program executes (always a useful way to instrument, and thus help debug, programs). We provide three possible verbosity levels:

  • OFF: Nothing besides the required matter is displayed (pass the third parameter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required