Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The venerable "expect"
Search
Bruno Sutic
January 29, 2015
Programming
0
51
The venerable "expect"
Expect tool fundamentals. Accompanying code:
https://gist.github.com/bruno-/dc4255f6d426af00c240
Bruno Sutic
January 29, 2015
Tweet
Share
More Decks by Bruno Sutic
See All by Bruno Sutic
Readline + irb/pry = <3
brunosutic
0
100
Moreutils
brunosutic
0
42
Capistrano vs Mina: Capistrano demo talk
brunosutic
0
420
Configuring tmux
brunosutic
0
69
Introduction to Arel
brunosutic
1
180
Tmux osnove
brunosutic
0
150
Deploying Rails apps with Capistrano
brunosutic
0
68
Other Decks in Programming
See All in Programming
C++でシェーダを書く
fadis
6
4.1k
Jakarta EE meets AI
ivargrimstad
0
130
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Click-free releases & the making of a CLI app
oheyadam
2
110
初めてDefinitelyTypedにPRを出した話
syumai
0
400
Jakarta EE meets AI
ivargrimstad
0
600
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
880
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
Outline View in SwiftUI
1024jp
1
330
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Ruby is Unlike a Banana
tanoku
97
11k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Embracing the Ebb and Flow
colly
84
4.5k
A better future with KSS
kneath
238
17k
We Have a Design System, Now What?
morganepeng
50
7.2k
The Cult of Friendly URLs
andyhume
78
6k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
Navigating Team Friction
lara
183
14k
Producing Creativity
orderedlist
PRO
341
39k
Transcript
The venerable “expect”
About: Bruno Sutic, github.com/bruno-/ Rails & Javascript developer Ideal Project
Group, Chicago
What is expect? • a classic Unix tool • enables
automating *everything* in the terminal • written in 1990, Tcl
Can’t script everything • ssh password entry? • sudo password
entry? • doing multiple ssh “hops”, usually password protected (enterprises, telecoms) • interactive command line applications (tmux) • (short demo)
Expect is… • surprisingly easy to learn • powerful •
easily available (installed by default on OS X) • does not replace scripting, use it for small % of tasks
Demo automating ssh tasks
Commands summary • spawn - starts a program • expect
- “listens” for output • send - “types” program input • interact - gives control to the user
Commands summary • log_user 0 - make the script quiet
• puts - print to the screen • set timeout 10 … timeout { exit 1 }
My real-world usage examples • Ericsson NT - automating SSH
connections (3-4 hops) • Automated testing for tmux plugins • tmux plugin manager • tmux copycat
Questions?