Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

The two commands shown next redirect their output: the first to an OSS file, and the second to a
Guardian file in the /G file system. The -nowait parameter is used to return control to the user
immediately after the commands are initiated:
osh -nowait -p /bin/ls /home/stu01 > /home/stu01/myfiles
osh -nowait -p /bin/ls /home/stu01 > /G/DATA01/STU01/MYFILES
In the following example, input is redirected from the Guardian file system (myfiles) with the left
angle bracket. Output is redirected to the user’s Guardian subvolume to a file called NEWFILE:
osh -p cat < /G/data01/stu01/myfiles > newfile
Redirecting Input and Output to the Guardian Environment
You can redirect the OSS standard files (stdin, stdout, stderr) to Guardian processes and EDIT files
by using the OSSTTY facility. OSSTTY can be used as a target for data redirection, providing a
capability similar to the UNIX pseudo-TTY feature ptty.
The following example starts OSSTTY, then starts an OSS shell and executes a single command.
Output sent to /G/tty/#stdout is received by OSSTTY and redirected to the EDIT file editfil.
TACL> run osstty /name $tty, out editfil, nowait/
TACL> osh -c "ls /home/stu01/testfil" > /G/tty/#stdout
The -nowait parameter is used to return control to the user immediately after the run command
is entered.
The following example illustrates the execution of an interactive shell using OSSTTY instead of
Telserv. An OSS application (testprog) receives input interactively from a Guardian process
($vhs, the Guardian virtual hometerm subsystem).
TACL> run osstty /name $tty, in $vhs, nowait/
TACL> osh -p /home/stu01/testprog < /G/tty/#stdin
OSSTTY is started with $vhs as its standard input. OSSTTY redirects this input to /G/tty/#stdin,
which is redirected to testprog.
See the Open System Services Management and Operations Guide for more information on
OSSTTY.
Interactively Using TACL and the OSS Shell
Most users want to switch from an interactive TACL session to an interactive OSS shell and continue
using the OSS shell. This operation is done with either of the following commands:
osh -ls
osh
The symbol in front of the ls flag (in this case, “-”) determines whether login initialization occurs
when the OSS shell is started. See “Factors Affecting Shell Operation” (page 54) for more
information on OSS shell start-up files and login initialization.
The Open System Services Shell and Utilities Reference Manual contains a complete description
of the osh(1) utility.
Running Guardian Commands From the OSS Shell
This subsection describes running Guardian commands from the OSS shell and getting information
into the OSS environments. The OSS gtacl utility creates a Guardian process to execute any of
the following from a OSS shell:
A Guardian program
A Guardian command (OBEY) file
A Guardian command, routine, alias, or macro
66 Interoperating Between User Environments