({{, (RefLink[RemoteConnectionObject, paclet:ref/RemoteConnectionObject])[…] 
is an object that represents a remote connection.}})

OpenersNotesSection(Spacer1)Details

(RefLink[RemoteConnectionObject, paclet:ref/RemoteConnectionObject]) can be used in (RefLink[RemoteRun, paclet:ref/RemoteRun]) and (RefLink[RemoteRunProcess, paclet:ref/RemoteRunProcess]) to execute multiple commands.

(RefLink[RemoteConnectionObject, paclet:ref/RemoteConnectionObject]) has the following properties:

OpenersPrimaryExamplesSection(Spacer1)Examples  (4)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Create a remote connection object:

remote = RemoteConnect["host.example.com"]

Display the time since boot for the remote machine:

RemoteRunProcess[remote, "uptime","StandardOutput"]

Write to the input stream of the remote object:

WriteLine[remote, "pwd"]

Read from the output stream:

ReadString[remote]

Close the session:

DeleteObject[remote]

OpenersExampleSection1(Spacer1)Scope  (1)

Connect to a remote host:

remote = RemoteConnect["arnoudcentoslx.wri.wolfram.com"];

The object contains properties relevant to the connection:

properties=remote["Properties"]

List the properties:

Dataset[AssociationMap[remote,properties]]

Close the session:

DeleteObject[remote]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

Create a remote connection object:

remote = RemoteConnect["host.example.com"];

Write to the input stream of the remote object:

WriteLine[remote["StandardInput"], "pwd"]

Read from the output stream:

ReadString[remote["StandardOutput"]]

Close the session:

DeleteObject[remote]

OpenersExampleSection4(Spacer1)Neat Examples  (1)

Create a remote connection object:

remote=RemoteConnect["host.example.com"];

Run WolframScript on the remote machine:

RemoteRunProcess[remote,"wolframscript -code '$MachineName'","StandardOutput"]

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Direct Control of External Processes, paclet:guide/DirectControlOfExternalProcesses])}})}})