From 0eae441e45bfa0fecc6b5c9b776b9d4a6dbb1add Mon Sep 17 00:00:00 2001 From: Remzi Arpaci-Dusseau Date: Mon, 22 Jan 2018 10:50:30 -0600 Subject: [PATCH] more clarification around building and running my-cat --- initial-utilities/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/initial-utilities/README.md b/initial-utilities/README.md index d48e113..841b5a3 100644 --- a/initial-utilities/README.md +++ b/initial-utilities/README.md @@ -39,6 +39,21 @@ prompt> ./my-cat main.c ``` As shown, **my-cat** reads the file **main.c** and prints out its contents. +The "**./**" before the **my-cat** above is a UNIX thing; it just tells the +system which directory to find **my-cat** in (in this case, in the "." (dot) +directory, which means the current working directory). + +To create the **my-cat* binary, you'll be creating a single source file, +**my-cat.c**, and writing a little C code to implement this simplified version +of **cat**. To compile this program, you will do the following: + +``` +prompt> gcc -o my-cat my-cat.c -Wall -Werror +prompt> +``` + +This will make a single *executable binary* called **my-cat** which you can +then run as above. You'll need to learn how to use a few library routines from the C standard library (often called **libc**) to implement the source code for this program,