Skip to Main Content
Mac OS X for Unix Geeks
book

Mac OS X for Unix Geeks

by Ernest E. Rothman, Brian Jepson
September 2002
Beginner to intermediate content levelBeginner to intermediate
216 pages
7h 43m
English
O'Reilly Media, Inc.
Content preview from Mac OS X for Unix Geeks

Sample Program

To demonstrate how to create a package, we’ll create a short C program and its associated manpage. Example 6-1 shows hellow.c and Example 6-2 shows its manpage, hellow.1.

Example 6-1. The Hello, World sample program
/*
 * hellow.c - Prints a friendly greeting.
 */

#include <stdio.h>

int main(  )
{
  printf("Hello, world!\n");
  return 0;
}
Example 6-2. The manpage for hellow.c
.\" Copyright (c) 2002, O'Reilly & Associates, Inc.
.\"
.Dd April 15, 2002
.Dt HELLOW 1
.Os Mac OS X
.Sh NAME
.Nm hellow
.Nd Greeting generator
.Sh DESCRIPTION
This command prints a friendly greeting.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mac OS X For Unix Geeks, 4th Edition

Mac OS X For Unix Geeks, 4th Edition

Ernest E. Rothman, Rich Rosen, Brian Jepson
Mac OS X Hacks

Mac OS X Hacks

Kevin Hemenway, Rael Dornfest
Mac OS X in a Nutshell

Mac OS X in a Nutshell

Jason McIntosh, Chuck Toporek, Chris Stone

Publisher Resources

ISBN: 0596003560Errata Page