Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ftexec

&pagelevel(3)&pagelevel

Note on usage

Function: Execute operating system commands in remote system

User group: FT user

Functional description

The ftexec command is used to execute operating system commands in the remote system. The resulting output for stdout and stderr is output in the local system on standard output (stdout) or standard error (stderr).

ftexec is only available for openFT partners, FTP partners and FTAM partners from Fujitsu Technology Solutions.

The end status, i.e. the result of the command, is also output in the local system as the end status of the ftexec command. If the end status received exceeds the value range of the local end status (Unix systems have only a 1-byte end status while Windows systems have a 4-byte end status), only the contents of the least significant byte are output. The significance of the end status is system-specific.

If the command is not executed in the remote system, an end message from the ftexec command is output to stderr, and ftexec terminates with the end status 255.

Notes on character sets

  • For commands to be executed in remote Unix or Windows systems, it is possible to set the so called "character mode", i.e. the commands are seen in their character presentation. The same applies to the local system if the commands are entered separately via stdin.

  • For output operations to stdout, it is possible to define character sets (-lc, -rc).

    In addition, you can define the "system character set" *SYS with -lc or -rc. *SYS then also applies to stderr.

  • For output operations to stderr, the following character sets are used depending on the system:

    • BS2000 and z/OS systems: character set defined in the system

    • Unix systems: ISO8859-1 or - in character mode - the character set defined via the operating parameter option -fnccs.

    • Windows systems: CP850 or UTF-8 in character mode

You will find further information on creating admission profiles for the ftexec function in the description of the ftcrep command, in particular the -fnp option.

If the partner is a Windows system, you can switch to another directory before calling the actual command as follows:

ftexec WinPart "cd path-name;command "...

path-name is then used as the current directory. There must not be a blank between the semicolon and the command. path-name must not be a directory which is addressed using a UNC name. Exception: The UNC checking is deactivated on the system on which the command is to be executed. To do this, the registry value described under https://support.microsoft.com/de-de/kb/156276 has to be generated.

Format

ftexec -h |

[ -t | -b | -l ]
[ -c ]
[ -fnc=t | -fnc=c ]
[ -lc=<CCS name 1..8> ] [ -rc=<CCS name 1..8> ]
<partner 1..200>
<command> | -
[ <transfer admission 8..67> | @n | @d |
<user ID 1..67>[,[<account 1..64>][,[<password 1..64>]]] ]

Description

-h

Displays the command syntax on the screen. Entries after the -h are ignored.

-t

This option indicates the transfer format for stdout is text. Tabulator expansion is deactivated.
Default value if a CCS name is specified (-lc and/or -rc).

-b

This option indicates that the transfer format for stdout is binary without conversion.
Default value if no CCS name is specified (neither -lc nor -rc).

-l

This option indicates that the transfer format for stdout is binary with <CRLF> converted to <LF> (transfer of text in binary format). This mode is only of use if both partners use ISO 646 or ISO8859-1 as the text format.

-c

Specifies that the data is also to be encrypted at transfer. The encryption of the request description data is not affected by this option. If the partner system cannot work with encryption, the request is rejected.

-fnc=t | -fnc=c (file name coding)

specifies the encoding mode for the commands to be executed in the remote system.

t (transparent, default value)

Specification of the commands to be executed in the remote system in transparent mode (compatible to the previous versions).

c (character)

Specification of the commands to be executed in the remote system in character mode. The commands are interpreted according to the character code of the remote system, i.e. for Unix partners according to the openFT operating parameter option (ftmodo -fnccs) that has been set there.

-fnc=c is only permitted for partners as of openFT V12.1.

-lc=CCS name

(local coding) specifies the type of coding (character set) to be used to read the local file. CCS name must be known in the local system (exception: *SYS, see below).

The default value is the character set defined by the FT administrator.

*SYS for CCS-name

-lc=*SYS causes that the following character set is used for stdout and stderr:

Unix systems: character set that results from the LOCALE and LANG-setting. Windows systems: UTF-8

-lc may not be combined with -b or -l.

Details about the CCS name and the associated code tables can be found in the manual "openFT (Unix and Windows systems) - Installation and Operation".

-rc=CCS name

(remote coding) specifies the type of coding to be used to read the data at the standard output from the remote command. CCS name must be known in the remote system (exception: *SYS, see below).

The default value is the character set defined in the remote system.

*SYS for CCS-name

-rc=*SYS causes that the following character set is used for stdout and stderr:

Unix systems: Character code set via openFT operating parameter option (ftmodo -fnccs).

Windows systems: UTF-8
BS2000 and z/OS systems: same as default value, i.e. the character set defined in the remote system.

The specification -rc=*SYS is intended on Unix systems for commands or programs, in which the output depends on local language settings. On Windows systems -rc=*SYS is suitable for programs that provide output in UTF-8.

-rc=*SYS is permitted only for partners with openFT as of V12.1.

-rc may not be combined with -b or -l.

The option -rc is supported only by the openFT protocol and partners with openFT V10.0 or higher. Please note that not all partner systems support all the character sets that are possible in the local system.

partner

partner is the name of the partner system in the partner list or the address of the partner system. For details on address specifications, see section “Specifying partner addresses”.

command | -

command is the command to be executed in the remote system. The syntax and the processing of the statements and commands depend on the conventions of the system on which the command is to be executed. A command sequence can only be processed in the remote system if an FT product that supports this function is being used there.

The maximum length of the command is 8191. Special characters count as being two characters (for the representation in UTF-8, see section “Entering commands” ).

- (dash) for command

You must enter the command after sending the ftexec command via stdin. You terminate entry by pressing the following keys:

<END> or CTRL+D (Unix systems)

CTRL+Z at the start of a line, followed by Return (Windows systems).

The entry is interpreted with the following character code depending on the encoding mode (-fnc):

  • Unix system in transparent mode: ISO8859-1

  • Unix system in character mode: the code that corresponds to the set LOCALE and LANG variables.

  • Windows system in transparent mode: ISO8859-1

  • Windows system in character mode: UTF-8

transfer admission | @n | @d |
user ID[,[account][,[password]]s]

If you want to execute a command on a remote system, you must furnish the remote system with proof of identity. For this purpose, you will need login authorization in the syntax valid for the remote system. You can specify this transfer admission

  • as an FTAC transfer admission if FTAC is used in the remote system,

  • or as a login/LOGON authorization in the syntax used by the remote system (user ID, possibly together with account or password).

For details, see section “Entering the authorization data for the partner system” .

@n for transfer admission

By entering @n you specify that the remote system requires no login authorization.

@d for transfer admission

Specifying @d (blanked transfer admission) causes openFT to query the transfer admission on the screen after the command is entered. Your entry is not displayed to prevent unauthorized persons from seeing the transfer admission.

A binary password or binary transfer admission must be specified in hexadecimal format, see section “Entering commands”.

password not specified

Omitting the password necessary for admission causes openFT to query the password on the screen after the command is entered. Your entry is not displayed to prevent unauthorized persons from seeing the password.

Nevertheless, you have to specify the commas, e.g.:

ftexec system command user-id,,

or

ftexec system command user-id,account,

neither transfer admission nor user ID specified

causes the same as @d, i.e. openFT queries the transfer admission on the screen after the command is entered. Your (blanked) entry is always interpreted as transfer admission and not as user ID.

Examples

  1. You want to look at the last 12 log records in the remote Unix system ux1 using the transfer admission Transunix1:

    ftexec ux1 "ftshwl -nb=12" Transunix1

  2. You want to look at the last 12 log records in the remote BS2000 system bs2 using the transfer admission Transbs2:

    ftexec -t bs2 "/SH-FT-LOG ,12" Transbs2

  3. You want to look at the last 12 log records in the remote z/OS system zos1 using the transfer admission TranszOS:

    ftexec -t zos1 "ftshwlog ,12" TranszOS