O'Reilly logo

The Linux Command Line by William E. Shotts Jr.

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 More Complete Application

After a long hiatus, we are going to resume work on our sys_info_page program. Our next addition will add several command-line options to the program as follows:

  • Output file. We will add an option to specify a name for a file to contain the program’s output. It will be specified as either -f file or --file file.

  • Interactive mode. This option will prompt the user for an output filename and will determine if the specified file already exists. If it does, the user will be prompted before the existing file is overwritten. This option will be specified by either -i or --interactive.

  • Help. Either -h or --help may be specified to cause the program to output an informative usage message.

Here is the code needed to implement the ...

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