cb Command

Purpose

Puts C source code into a form that is easily read.

Syntax

cb-s ] [  -l Length-j ] [ File ... ]

Description

The cb command reads C programs from standard input or from specified files and writes them to standard output in a form that shows, through indentations and spacing, the structure of the code. When called without flags, the cb command does not split or join lines. Note that punctuation in preprocessor statements can cause indentation errors.

For best results, use this command on source code that is syntactically correct.

Flags

Item Description
-j Joins lines that are split. Ignored if -l flag is given.
-l Length Splits lines that are longer than Length characters.
-s Formats the source code according to the style of Kernighan and Ritchie in The C Programming Language (Englewood Cliffs, New Jersey: Prentice-Hall, Inc., 1978).

Example

To create a version of pgm.c called pgm.pretty.c that is easy to read, enter:

cb pgm.c > pgm.pretty.c

Files

Item Description
/usr/ccs/bin/cb Contains the cb command.
/usr/bin/cb Symbolic link to the cb command.