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
160
Deploying Rails apps with Capistrano
brunosutic
0
69
Other Decks in Programming
See All in Programming
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
420
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
13
2.1k
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
110
令和7年版 あなたが使ってよいフロントエンド機能とは
mugi_uno
10
5k
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
170
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.3k
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
560
情報漏洩させないための設計
kubotak
5
1.3k
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.8k
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Designing Experiences People Love
moore
139
23k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Typedesign – Prime Four
hannesfritz
40
2.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Docker and Python
trallard
43
3.2k
Into the Great Unknown - MozCon
thekraken
34
1.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Git: the NoSQL Database
bkeepers
PRO
427
64k
jQuery: Nuts, Bolts and Bling
dougneiner
62
7.6k
Code Review Best Practice
trishagee
65
17k
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?