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
52
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
190
Tmux osnove
brunosutic
0
150
Deploying Rails apps with Capistrano
brunosutic
0
68
Other Decks in Programming
See All in Programming
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
130
ドメインイベント増えすぎ問題
h0r15h0
2
300
Security_for_introducing_eBPF
kentatada
0
110
Recoilを剥がしている話
kirik
5
6.7k
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
testcontainers のススメ
sgash708
1
120
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
380
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
280
Zoneless Testing
rainerhahnekamp
0
120
Featured
See All Featured
A Tale of Four Properties
chriscoyier
157
23k
Typedesign – Prime Four
hannesfritz
40
2.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Building Applications with DynamoDB
mza
91
6.1k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Bash Introduction
62gerente
608
210k
Into the Great Unknown - MozCon
thekraken
33
1.5k
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?