[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 6


what Command

Purpose

Displays identifying information in files.

Syntax

what-s ] File ...

Description

The what command searches specified files for all occurrences of the pattern that the get command substitutes for the @(#) keyletter (see the get or prs command for a description of identification keywords). By convention, the value substituted is "@(#)" (double quotation marks, at sign, left parenthesis, pound sign, right parenthesis, double quotation marks). If no file is specified, the what command reads from standard input.

The what command writes to standard output whatever follows the pattern, up to but not including the first double quotation mark ("), greater than symbol (>), new-line character, backslash (\), or null character.

The what command should be used in conjunction with the get command, which automatically inserts the identifying information. You can also use the what command on files where the information is inserted manually.

Note: The what command may fail to find SCCS identification strings in executable files.

Flags


-s Searches for only the first occurrence of the @(#) pattern.

Exit Status

This command returns the following exit values:

0 Any matches were found.
1 Otherwise.

Examples

Suppose that the file test.c contains a C program that includes the line:

char ident[ ] = "@(#)Test Program";

If you compile test.c to produce test.o, then the command:

what test.c test.o 

displays:

test.c:
Test Program
test.o:
Test Program

Files


/usr/bin/what Contains the what command.

Related Information

The get command, sccshelp command.

The sccsfile file format.

List of SCCS Commands in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.

Source Code Control System (SCCS) Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]