You can redirect output from any command. However, the most common use for redirecting output is to save the output from query commands. The output from some query commands can be quite lengthy, and it can be easier for you to browse the contents of a file or, in some cases, print the contents of the file.
Some platforms support redirection of output via special characters like >, >>, and |. You can save the output from a command by entering redirection characters at the end of the command. Redirection characters direct the output of a command to a file or program you specify instead of to your screen. See the examples below.
The secret to using a > sign from the administrative command line client so that the output is not redirected is to NOT leave a blank after the > symbol. The following will not redirect the output:
SELECT * FROM NODES WHERE CLIENT_VERSION >2
If you want to: | Enter this: |
---|---|
Redirect the output of a QUERY DOMAIN command to a new file in batch or interactive mode |
dsmadmc -id=xxx -pa=xxx query domain acctg > dominfo.acc A single greater-than sign (>) indicates that TSM redirects the output to a new file or writes over an existing file. |
Append the output of a QUERY DOMAIN command to the end of an existing file in batch or interactive mode |
dsmadmc -id=xxx -pa=xxx query domain acctg >> dominfo.acc Double greater-than signs (>>) indicates that TSM appends the output to the end of an existing file. |
Redirect all output from an administrative client session in console mode to a program called filter.exe. |
dsmadmc -console -id=admin -password=xxx | filter.exe The program can be set up to monitor the output for individual messages as they occur and take appropriate action, such as sending mail to another user. |