Keywords are commonly used in the header section of ascii based
objects, but you can also embed keywords into your compiled products.
About this task
There are two ways to embed keywords into a product of a
build. Both methods involve adding keywords to the source files of
a build.
Procedure
- If your compiler supports the #ident directive,
which is a feature of C compilers, perform the following steps:
- Add these lines to your source files:
#ident "%full_filespec: %"
#ident "%created_by: %"
#ident "%date_created: %"
- Run the mcs -p command to display the keyword
information.
- If your complier does not support the #ident directive,
perform the following steps:
- Use the @(#) notation in a static string definition
in your source files:
The built-in source template for the java type
contains this string definition:
public static final
string SCCS_ID = "@(#) %full_filespec: %"
- Run the what command to display the keyword information.
The what command
is available on many UNIX installations.
If the command is not available, use the strings command,
which is available on most UNIX installations.