1X3270IF(1) General Commands Manual X3270IF(1)
2
3
4
6 x3270if - command interface to x3270, c3270 and s3270
7
9 x3270if [option]... [ action ]
10 x3270if -i
11
13 x3270if provides an interface between scripts and the 3270 emulators
14 x3270, c3270, and s3270.
15
16 x3270if operates in one of two modes. In action mode, it passes a sin‐
17 gle action and parameters to the emulator for execution. The result of
18 the action is written to standard output, along with the (optional)
19 status of the emulator. (The action is optional as well, so that
20 x3270if can just reports the emulator status.) In iterative mode, it
21 forms a continuous conduit between a script and the emulator.
22
23 The action takes the form:
24
25 action-name(param[,param]...)
26
27 The parentheses are manatory, and usually must be quoted when x3270if
28 is called from a shell script.
29
30 If any param contains a space or comma, it must be surrounded by double
31 quotes.
32
34 -s field
35 Causes x3270if to write to stdout the value of one of the emula‐
36 tor status fields. Field is an integer in the range 0 through
37 11. The value 0 is a no-op and is used only to return exit sta‐
38 tus indicating the state of the emulator. The indices 1-11 and
39 meanings of each field are documented on the x3270-script(1)
40 manual page. If an action is specified as well, the status
41 field is written after the output of the action, separated by a
42 newline. The -s option is mutually exclusive with the -S and -i
43 options.
44
45 -S Causes x3270if to write to stdout the value of all of the emula‐
46 tor status fields. If an action is specified as well, the sta‐
47 tus fields are written after the output of the action, separated
48 by a newline. The -S option is mutually exclusive with the -s
49 and -i options.
50
51 -i Puts x3270if in iterative mode. Data from x3270if's standard
52 input is copied to the emulator's script input; data from the
53 emulator's script output is copied to x3270if's standard output.
54 The -i option is mutually exclusive with the -s and -S options.
55 x3270if runs until it detects end-of-file on its standard input
56 or on the output from the emulator. (This mode exists primarily
57 to give expect(1) a process to run, on systems which do not sup‐
58 port bidirectional pipes.)
59
60 -p process-id
61 Causes x3270if to use a Unix-domain socket to connect to the
62 emulator, rather than pipe file descriptors given in environment
63 variables. The emulator must have been started with the -socket
64 option.
65
66 -t port
67 Causes x3270if to use a TCP socket to connect to the emulator,
68 rather than pipe file descriptors given in environment vari‐
69 ables. The emulator must have been started with the -scriptport
70 option.
71
72 -v Turns on verbose debug messages, showing on stderr the literal
73 data that is passed between the emulator and x3270if.
74
76 In action mode, if the requested action succeeds, x3270if exits with
77 status 0. If the action fails, x3270if exits with status 1. In itera‐
78 tive mode, x3270if exits with status 0 when it encounters end-of-file.
79 If there is an operational error within x3270if itself, such as a com‐
80 mand-line syntax error, missing environment variable, or an unexpect‐
81 edly closed pipe, x3270if exits with status 2.
82
84 When a script is run as a child process of one of the emulators via the
85 Script action, the emulator passes information about how to control it
86 in environment variables.
87
88 On Unix, the emulator process creates a pair of pipes for communication
89 with the child script process. The values of the file descriptors for
90 these pipes are encoded as text in two environment variables:
91
92 X3270OUTPUT
93 Output from the emulator, input to the child process.
94
95 X3270INPUT
96 Input to the emulator, output from the child process.
97
98 On Windows, or when a Unix emulator is started with the -scriptport
99 option, the emulator will pass the port number encoded as text in the
100 X3270PORT environment variable. x3270if will use that value as if it
101 had been passed to it via the -t option. X3270PORT takes precedence
102 over X3270OUTPUT and X3270INPUT.
103
105 x3270(1), c3270(1), s3270(1), x3270-script(1)
106
108 Copyright 1999-2009, Paul Mattes.
109 All rights reserved.
110
111 Redistribution and use in source and binary forms, with or without mod‐
112 ification, are permitted provided that the following conditions are
113 met:
114
115
116 * Redistributions of source code must retain the above copyright
117 notice, this list of conditions and the following disclaimer.
118
119 * Redistributions in binary form must reproduce the above copy‐
120 right notice, this list of conditions and the following dis‐
121 claimer in the documentation and/or other materials provided
122 with the distribution.
123
124 * Neither the names of Paul Mattes nor the names of his contribu‐
125 tors may be used to endorse or promote products derived from
126 this software without specific prior written permission.
127
128
129 THIS SOFTWARE IS PROVIDED BY PAUL MATTES `AS IS' AND ANY EXPRESS OR
130 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR‐
131 RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
132 DISCLAIMED. IN NO EVENT SHALL PAUL MATTES BE LIABLE FOR ANY DIRECT,
133 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
134 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SER‐
135 VICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
136 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIA‐
137 BILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
138 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
139 SUCH DAMAGE.
140
141
142
143 25 August 2012 X3270IF(1)