automation enabled community medium v1.0.0

expect

Automates interactive applications, can read files and spawn interactive shells.

📋 Live Preview
expect {c}
📎 c
expect {c}

Sandbox: execFile · Timeout: 30s

Capabilities

system.file.read
security.privilege-escalation.shell
automation.script

Parameters

Name Type Required Default Description Aliases
c string No - Command to execute -c

Contract

Inputs

system.file.path

Path to expect script

Outputs

process.output

Shell or command output

Side effects: process_spawn

Workflow Edges

Produces

process.output

Consumes

system.file.path

Resource Profile

ResourceValue
CPUlow
Memory4 MB
Networklow
Disk I/Olow

Examples

Read arbitrary file via parsing error message

expect /path/to/input-file

Spawn interactive shell

expect -c 'spawn /bin/sh;interact'

Spawn privileged shell with SUID

expect -c 'spawn /bin/sh -p;interact'

Documentation

expect — Programmed Dialogue with Interactive Programs

expect automates interactive applications. When used with sudo or SUID, it can read files through parsing errors and spawn interactive shells via the spawn and interact commands.

References