Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

User Commands (m - o) osh(1)
10. Running the osh process programmatically from a Guardian environment C program:
void main( void )
{
short myprocesshandle[ 10 ];
char myterm[ 64 ];
short mytermlen;
char cmd[ 255 ];
/* Get the home terminal name */
PROCESSHANDLE_NULLIT_( myprocesshandle );
PROCESS_GETINFO_( myprocesshandle ,
/* lename */, /* lenamemaxlen */,
/* lenamelen */, /* pri */, /* mom */,
myterm, ( short )( sizeof ( myterm ) - 1),
&mytermlen );
myterm[ mytermlen ] = \0;
/* Build the command line */
sprintf ( cmd, "osh / IN %s, OUT %s / -c \"%s \"",
myterm, myterm, shcmd );
system ( cmd );
exit ( 0 );
}
where shcmd is any valid OSS shell command.
527188-007 Hewlett-Packard Company 6103