#!/bin/bash
file_path="/path/to/my/files"
date=$(date +"%Y%m%d%H%M%S")
x3270if "connect(L:ssl3270.myhost.org:2023)"
x3270if "printtext(html,file,$file_path/myhost-$date.html)"
x3270if "string(command1)"
x3270if "enter"
x3270if "printtext(html,file,$file_path/myhost-$date.html)"
x3270if "enter"
x3270if "string(command2)"
####
the peer script facility, invoked by the x3270 -script switch, and the default mode for s3270 and ws3270. This runs x3270, s3270 or ws3270 as a child of another process. Typically this would be a script using expect(1), perl(1), or the co-process facility of the Korn Shell ksh(1). Inthis mode, the emulator process looks for commands on its standard input, and places the responses on standard output and standard error output.
####
#!/usr/bin/perl
sub launch_s3270
{
# Some magic to launch s3270 as a child process and retain the ability to write to it
}
sub connect_3270
{
print $s3270 "connect(L:ssl3270.myhost.org:2023)";
}