Standard IO Redirection and Event Handler Processes

Overview

Universal Event Monitor currently does not provide any native support for redirecting standard input and output to or from a process. However, it is possible to instruct the operating system to redirect standard I/O during process execution.

These pages describe how to redirect standard I/O for event handlers that execute a command or a script. They also explains how an event definition's HANDLER_OPTIONS option can be used to control standard i/o redirection.

Redirection Symbols

I/O redirection is done using one of the following redirection symbols:
 

Symbol

Meaning

Description

<

Redirect standard input using an existing file.

If an application supports it, standard input redirection can be used as a batch alternative to input that is normally obtained interactively from the user.

>

Redirect standard output to a specified file.

When a single > is used and the specified file exists, its contents are overwritten.
 
The file is created if it does not exist.

>>

Redirect standard output and append it to a specified file.

If the specified file exists when this symbol is used, output generated by the process is added to the end of the specified file, preserving the file's current contents.
 
The file is created if it does not exist.

2>

Redirect standard error to a specified file.

If the specified file exists, its contents are replaced.
 
The file is created if it does not exist.
 
If standard output also is being redirected to a file, an ampersand ( & ) followed by a 1 (which the operating system recognizes as an identifier for standard output) can be used in place of a file name. This causes standard error to be written to the same file used for standard output.
 
For example, 2>&1 instructs the operating system to send all messages generated by the application that are destined for standard output and standard error to be written to the same file.

2>>

Redirect standard error and append it to a specified file.

If the specified file exists when this symbol is used, messages written by the application to standard error are added to the end of the specified file.
 
If standard output also is being redirected to a file, an ampersand ( & ) followed by a 1 (which the operating system recognizes as an identifier for standard output) may be used in place of a file name. This causes standard error to be appended to the same file used for standard output.
 
For example, 2>>&1 instructs the operating system to send all messages generated by the application that are destined for standard output and standard error to be written to the same file.

Detailed Information

The following pages provide detailed information for Standard IO Redirection and Event Handler Processes: