toy-core Build Status

An experiment: this repo will contain toy implementations of various core command line utilities.

You should not use anything in here for real work. I promise that they will be incomplete and buggy. The whole point is for me to learn a little more about C and Unix by writing these. They aren't meant to be substitutes for anyone's actual core-utils.

Existing utilities

  • toy-tail

Works pretty much like tail but simplified. Shows the last ten lines of one or more files (given as arguments) or stdin, if no arguments are given. Accepts -h to show simple usage and -c NUMBER to switch from the default ten lines to another number.

Run make toy-tail to build it.

  • toy-echo

Yup, you guessed it. toy-echo is just like echo. The -n flag to echo without a final newline is guaranteed to work on this one though.

Run make toy-echo to build it.

  • toy-cat

At this point, it's almost too obvious: toy-cat is basically cat, but with fewer flags. It only supports -h and -n. So you can get help or line numbers. That's it.

  • toy-head

Does what head does. Accepts -h to show usage and -c NUMBER to choose how many lines from the top of the file to show. The default number of lines to show is ten.

Run make toy-head to build it.

make all should always build all utilities present.