Category: Programming
Tags: #youtube #iprogrammer #gcc #c #command-line
Published: 2019-07-20

Writing a Command Line Utility in C Pt 1

Writing a command-line utility in C requires the understanding of several things beyond the c programming language: command-line parameters, how the parameters are passed into the program, how to parse the parameters in code; and how to use streams for both input and output. This episode is a real-time coding session where, from scratch, I use vim to write a basic C program that demonstrates how to read and interpret the parameters passed to the program via the command-line. I also demonstrate how to explore and understand the parameters through code. Using gcc to compile and link the program along the way, we end up with a command-line utility that can interpret a help switch and accept and process one parameter.

Some useful links are:

The c programming language https://en.wikipedia.org/wiki/C_(programming_language)

GCC https://en.wikipedia.org/wiki/GNU_Compiler_Collection

Vim https://en.wikipedia.org/wiki/Vim_(text_editor)

Unix https://en.wikipedia.org/wiki/Unix

Command Line Interface https://en.wikipedia.org/wiki/Command-line_interface

Don’t forget to like the video and subscribe to the channel!