/
Use UNIX tee Command to Store stdout to Local Server and zOS

Use UNIX tee Command to Store stdout to Local Server and zOS

Use UNIX tee Command to Store stdout to Local Server and z/OS

This example demonstrates using the UNIX tee command to save the standard out of a command to a file on the remote system, as well as send it back to the UCMD Manager in real time.

The UNIX ls command is executed in this example. The ls command writes the file listing to its standard out, which is piped to the tee command. The tee command reads the ls listing and writes it to both the file teeout.txt and to standard out, which is redirected to the UCMD Manager on z/OS. The UCMD Manager writes the standard out to ddname UNVOUT.


//jobname  JOB CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//* 
//         JCLLIB ORDER=SBI.UNV.SUNVSAMP
//* 
//STEP1 EXEC UCMDPRC 
//SCRIPT DD * 
  ls | tee teeout.txt
//SYSIN DD *
-script   SCRIPT 
-host     hostname 
-userid   username
-pwd      password
/*

SYSIN Options

Option

Description

/wiki/spaces/UA73/pages/3770735ddname from which to read a script file. The script file is sent to the remote system by UCMD Manager for execution.

/wiki/spaces/UA73/pages/3770747

Host name or IP address of the remote system on which to execute the script.

/wiki/spaces/UA73/pages/3778830

Remote user ID with which to execute the command.

/wiki/spaces/UA73/pages/3778826

Password for the user ID.

Components

/wiki/spaces/UA73/pages/3770655

 
 

Related content