The text data that xcat receives as input can also be output from xcat through the stdout mechanism unchanged. This is enabled by the command line option -p. An example of using this option would be to create a window into a processing stream where the data could be visually verified without interrupting the processing flow:
In this example, create_data and process_data represent programs which would create and process text data, respectively. To simply display a file on a Unix file system, xcat works similarly to the Unix cat command. For instance, Figure 2 shows an example of executing:
Here, demofile is a file containing common text and tab characters.
By default, two buttons appear below the displayed text which each serve dual functions while the text is being received vs. after all text has been displayed. During processing of input data, the buttons will allow control of the scrolling in the text window and termination of the input data processing. The appearance of the main panel in this mode is shown later in Figure 5. After receipt of all the input data, the function of these buttons switches to that of a text processing button and panel dismissal button. By default, the processing button on the left is used for piping the text data on to a print command. This occurs automatically, assuming that the PRINTER or LPDEST variable is set, depending on the type of Unix system in use, in the user's environment. Alternately, an environmental variable called XCAT_PRINT_CMD may be set, which may contain a command string to which the entire contents of the text window will be piped. For example, to run the contents through the Unix command enscript to rotate the text rather than the using the default print command, this could be set to enscript -r. It should also be noted that this command need not necessarily be a print command. It may be any command capable of processing text. For that reason, there are options for changing the label and function of this button via the command line arguments -pc and -pl, or the X11 resources *printCmd or *printLabel, respectively. In order to edit the text in the display window before further processing, the text widget must have been declared editable, either through the specification of -ed on the command line or via the *editable resource specification. Further details on the main panel's processing buttons will be given later on in this paper.
A special option was written into the program to take advantage of the graphical ability to highlight or underscore text. This is enabled by the -man command line option or the *manPrinting X11 resource. Figure 4 shows an example of text displayed using this option in the command:
The child process, in this case ping. will run until the process exits normally, or is forcefully terminated by pressing the button labelled kill input.
Either pulldown or any of the functions contained within may be accessed via the accelerator keys associated with them. The accelerator for the File pulldown is MAlt<F> and for the Help pulldown it is MAlt<H>, where MAlt refers to the Meta or Alt key, depending on the keyboard in use. Figure 7 shows how the File pulldown would appear on an xcat invocation which was started without a menubar. The accelerator functions for the individual functions contained in each pulldown are shown to the right of each pulldown button. For example, the Save function may be accessed at any time via the key sequence MCtrl<S>. This capability to access these functions even without the menubar enhances xcat's functionality as a tool to be used by other applications.
The first xcat will list the directories under the current directory and the second xcat which will be run as a child will show the files under the highlighted directory. In the case shown, the sun4 directory has been highlighted in the directory list and the button labelled list files pressed. The child xcat then shows a list of the files within the directory.
Note that the title specified for the child instance of xcat also contains a dynamic window title containing the specified directory's name. This begins to show the capabilities of xcat as a tool rather than a simple display window. By taking the example shown above one step further and putting in an option to run an xterm with a vi editing session on the picked file, we have built a simple type of file manager:
The results are shown in Figure 9. In both examples, note the use of single quotes on the command line is to get around interpretation by the current shell of special characters such as \, which is used in the find command.
Users are encouraged to simply try using some of these functions and experiment with the options available. A quick list of the options may be obtained by entering:
A more detailed manual page is available on the Sun systems by entering:
The program has been installed on Sun, Cray, SGI, HP, Convex, and IBM AIX platforms under the exploration products area.
Return to the USP Home Page.Frame Doc to html conversion by Tony Garossino