Home » ComputerScience » Re-Writing BSD 4.4 Shell Commands: cat

Re-Writing BSD 4.4 Shell Commands: cat

A new series on youtube is attempting to “re-write” UNIX Commands like it’s 1994. I think he’s doing a great job so far. Below is the first installation. I just subscribed to his channel and can’t wait till the next installations.

The author talks about parsing C command line arguments “the old school way”. I’m not sure what he means by that, but he also could have used a GNU function called getopt to parse the command line options. Here’s an example from GNU:

https://www.gnu.org/software/libc/manual/html_node/Example-of-Getopt.html

In addition, I’ll also link to this other article on command line parsing in C – it shows examples both with and without the getopt function:

https://www.cs.rutgers.edu/~pxk/416/notes/c-tutorials/getopt.html

Leave a Reply