il migliore è pacchetto "tn5250" perché si integra meglio con GnomeTerminal(gestione dei font, delle tab), non funzionano i binari di suse/debian perché ubuntu ha ssl2 incompatibile per compilare dai sorgenti:
cd /usr/local/bin/tn5250-0.17.4/ ./configure --help ./configure --with-ssl=NO --with-curses=YES make sudo make install rm /usr/local/bin/tn5250 sudo ln -s /usr/local/bin/tn5250-0.17.4/curses/tn5250 /usr/local/bin/tn5250 man tn5250 man tn5250rc
~/.tn5250rc
as400 { host = $IP map = 280 env.TERM = IBM-3477-FC -underscores }
tasti funzione F13-F24:
Ctr + Shift + F1-F12
pacchetti di interesse:
#!/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)" x3270if "enter"
<?php
//------------------------------------------------------------------------------
// main
//------------------------------------------------------------------------------
$descriptorspec = array(
0 => array("pipe","r"),
1 => array("pipe","w"),
2 => array("pipe","w")
);
$process = proc_open('/usr/local/bin/s3270', $descriptorspec, $pipes, null, null);
stream_set_blocking($pipes[0], 0);
stream_set_blocking($pipes[1], 0);
if(is_resource($process)) {
fwrite($pipes[0], "connect(L:hostname:port)\n");
fwrite($pipes[0], "ascii()\n");
expecttxt("CDN");
fwrite($pipes[0], "string(session-name)\n");
fwrite($pipes[0], "enter\n");
fwrite($pipes[0], "ascii()\n");
expecttxt("SESSION STATUS");
fwrite($pipes[0], "PF(2)\n");
fwrite($pipes[0], "ascii()\n");
expecttxt("NEXT INFO");
}
// This function will watch for text on the screen similar to Expect but without having to install an additional module and configure it.
// Basically until the text shows up on the screen it will continually re-run the ascii() command and wait indefinitely.
function expectemp ($thetxt) {
global $pipes;
$g = false;
for($i = 1; $i <= 10; $i++) {
sleep(1);
while ($mydat = fgets($pipes[1])) {
if (preg_match("/$thetxt/i", $mydat)) {
$g = true;
}
if ($g == true) {
while ($mydat = fgets($pipes[1])) {
}
$i = 11;
break 2;
}
}
fwrite($pipes[0], "ascii()\n");
}
}
// This function is the same as above except it will only wait about 10 seconds for a response and then continue running the script.
function expecttxt($thetxt) {
global $pipes;
$x = false;
$g = false;
while ($x == false) {
sleep(1);
while ($mydat = fgets($pipes[1])) {
if (preg_match("/$thetxt/i", $mydat)) {
$g = true;
}
if ($g == true) {
while ($mydat = fgets($pipes[1])) {
}
$x = true;
break 2;
}
}
fwrite($pipes[0], "ascii()\n");
}
}
invenuto in https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=ial
installare versione 32bit della dll openmotif, ma mancano troppe dipendenze/dll
sudo ln -s /usr/lib/libXm.so.3.0.3 /usr/lib/libXm.so.3
lanciare da:
/opt/ibm/iSeriesAccess/bin64/ibm5250