Product Documentation

c-treeRTG COBOL Edition User's Guide

Previous Topic

Next Topic

ctutil Notes

CTUTIL uses stdout to output data and stderr to output the program status. If you do not want to see the status message "Operation completed successfully" you can redirect the stderr stream:

$ ctutil >/tmp/output.txt 2>/tmp/error.txt

In the example below, if you want to redirect both stdout and stderr you could use the following:

$ ctutil -info /usr/tree/r1/sc0001/LP/LNFILE >/usr/tmp/km.txt 2>&1

Please notice that “2>&1” means “redirect stderr (stream 2) to stdout (stream 1).” ctutil uses stdout to output data and stderr to output the program status.

If you want to know if the ctutil command was successful despite the output, you can check the return value of ctutil.

Unix:

$ ctutil >/tmp/output.txt 2>/tmp/error.txt

$ [ $? -eq 0 ] && echo OK

Windows:

C:\> ctutil >/tmp/output.txt 2>/tmp/error.txt

C:\> @if errorlevel 0 echo OK

TOCIndex