|
|
|
|
SSHCommand (Function) In french: SSHCommande Sends a command to an SSH server. The session is automatically started and closed as soon as the command is sent.
cMaSession is sshSession
cMaSession.Address = "127.0.0.1"
cMaSession.Port = 22
cMaSession.User = "login"
cMaSession.UserPassword = "pass"
nExitCode is int
sSortie is string ANSI
sSortieErr is string ANSI
(nExitCode, sSortie, sSortieErr) = SSHCommand(cMaSession, SAI_Commande)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
RETURN
END
SAI_ExitCode = nExitCode
SAI_StdOut = UTF8ToString(sSortie)
SAI_StdErr = UTF8ToString(sSortieErr)
cMaSession is sshSession
cMaSession.Address = "127.0.0.1"
cMaSession.User = "login"
cMaSession.UserPassword = "pass"
bufDonnéesEnvoyées is Buffer = `Il est [%HeureVersChaîne(HeureSys, "HH:mm:SS")%]`
nExitCode is int
sSortie is string ANSI
sSortieErr is string ANSI
(nExitCode, sSortie, sSortieErr) = SSHCommand(cMaSession, ...
"echo $(</dev/stdin) > donnees_envoyees.txt; cat donnees_envoyees.txt", bufDonnéesEnvoyées)
Trace(sSortie)
Syntax
(<Result>, <Data received>, <Data if error>) = SSHCommand(<SSH session> , <Order> [, <Data to send>])
<Result>: entier Exit code of the command. <Data received>: Buffer Data received from the server. <Data if error>: Buffer Data received from the server if an error occurs. <SSH session>: sshSession variable Name of sshSession variable corresponding to the SSH session on which the command must be run. <Order>: Character string Command that must be sent to the SSH server. <Data to send>: Optional buffer Data that must be sent to the server. This data can be read from the standard input (stdin). Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|