User manual

Using UNIX Tool With APGEN Script Files
893-769-A 4-3
The result of the diff command shows a list of lines from both scripts. Lines preceded with the < character
appear in the first file, but not the second. Lines preceded with the > character appear in the second file, but
not the first. From this information, you can determine which features are enabled in one file but not the
other, or the value of a particular feature in one file and in the other if they are different.
Using the grep Utility to Search Through an APGEN File
The grep utility, including egrep and fgrep, searches through a file for the text strings you specify. You can
write the output to the screen, or to another file that you can edit and modify. Some common uses of the
grep utility with APGEN script files are the following:
To extract and display a limited number of command lines from a script file and determine their status
To extract a limited number of command lines from a script file, write them to another file and create a
script from the new file
See the man pages on your UNIX system for complete information about the grep, egrep, and fgrep
commands.
Displaying Command Lines
The grep utility is useful if you want to extract limited information from a large script file. For example,
you might want to check the value of terminal server time-to-live (TTL) values. Rather than opening the
script file with an editor and searching through it, you can use the TTL string in a grep command. (Most
UNIX systems are case-sensitive, so be sure to enter the string in the correct upper- and lower-case letters.)
% grep -e TTL script.apg
DEFINE SERVER INTERNET TTL 64
DEFINE SERVER INTERNET DOMAIN TTL 0
%
By default, the grep command writes the output to the screen, and you can immediately see the TTL values.