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
20140529_nanapistudy_vol2_pub.pdf
Search
wadap
May 29, 2014
Technology
1
2.9k
20140529_nanapistudy_vol2_pub.pdf
wadap
May 29, 2014
Tweet
Share
More Decks by wadap
See All by wadap
20200311_コネヒト_リモートワークを支える文化
wadap
2
2.5k
副業が難しいと思う理由
wadap
3
600
2016-11-10_chuo_university
wadap
2
3.8k
how_to_survive.pdf
wadap
0
100
how_to_choose_technology
wadap
7
4.2k
nanapiの会社風土と文化づくり
wadap
2
23k
20140826_nanapi_engineer_culture_pub.pdf
wadap
2
140
nanapiの開発現場をどのようにして回しているか
wadap
40
11k
nanapi TechBlog
wadap
1
6.9k
Other Decks in Technology
See All in Technology
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
270
なぜCodeceptJSを選んだか
goataka
0
160
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
200
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
310
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
170
非機能品質を作り込むための実践アーキテクチャ
knih
5
1.4k
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
190
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
160
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
750
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
540
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
170
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
169
14k
The Cult of Friendly URLs
andyhume
78
6.1k
Unsuck your backbone
ammeep
669
57k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
A better future with KSS
kneath
238
17k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Transcript
nanapi ษڧձ vol2 - Shellษڧձ - nanapi CTO Shuichi Wada
/ @wadap
• ࣮·ͩ2ճΊͷnanapiओ࠵ ͷษڧձͰ͢ • ಛʹςʔϚͳ͘ɺͦͷ࣌ʹ ڵຯ͋Δ͜ͱͰΓ·͢ • લճ։ൃڥʹ͍ͭͯ͢ ͷΛΓ·ͨ͠ nanapiษڧձͱʁ
ࣗݾհ • ాमҰ / @wadap • 1981ੜ·Ε • גࣜձࣾnanapi Co-Founderʢڞಉۀऀʣ
औక ࣥߦһ CTO • αʔόΠϯϑϥʙαʔόαΠυ։ൃ͕ಘҙ • ݱࡏͰΠϯϑϥपΓͷϝΠϯΤϯδχΞ
ຊͷςʔϚ
None
λʔήοτ • γΣϧૢ࡞ΛݟΒΕͯɺޙΖͷਓʹ͔ͭΕͨਓ • ͍ͭͷۀΛΑΓ͘ɺޮΑ࣮͘ߦ͍ͨ͠ਓ • γΣϧͷૢ࡞ʹࣗ৴͕ͳ͍ਓ
ͲΜͳ৬छʁ • ։ൃͷԆઢͰUnix/Linux৮ͬͯΔΤϯδχΞ • ͕ͬͭΓUnix/Linux৮ͬͯΔΤϯδχΞ • ΤϯδχΞ͡Όͳ͍ʢσβΠφʔͱ͔ʣ
ຊ
ຊͳ͢͜ͱ ϫϯϥΠφʔͰTIFMM͠Α͏ FNBDT͔ΒTIFMMΛ͏͍͔ͭ͘ͷํ๏
ຊͳ͢͜ͱ ϫϯϥΠφʔͰTIFMM͠Α͏ FNBDT͔ΒTIFMMΛ͏͍͔ͭ͘ͷํ๏
͜Μͳ͜ͱͬͯ·ͤΜ͔ʁ $ cd /path/to/dir $ ls foo bar buzz $
mv foo foo.bak $ mv bar bar.bak $ mv buzz buzz.bak
shellscriptʹ͢Δͱ͜͏ #!/bin/sh ! LIST=$(ls /path/to/dir) for i in $LIST do
mv $i{,.bak} done
1ߦͰΔͱ͜Μͳײ͡ for i in $(ls /path/to/dir); \ do mv $i{,.bak};
done
for͕͑ΔͱḿΔ • shellૢ࡞ͬͯ܁Γฦ͠࡞ۀଟ͍ • forΛ͔ͭͬͨॻ͖ํ͕છΈ͚Δͱ͍͍ • ίϚϯυஔΛҾʹͱΔͱศར
$ dig s.nanapi.jp $ dig p.nanapi.jp $ dig m.nanapi.jp υϝΠϯʴIPΞυϨεͷ
ରԠදͭ͘Γ͍ͨ
υϝΠϯʴIPΞυϨεͷ ରԠදͭ͘Γ͍ͨ for i in m p s ; \
do host $i.nanapi.jp ; \ done | grep addr | \ awk '{print $1" "$4}'
࿈൪ϑΝΠϧͭ͘Γ͍ͨ • seqίϚϯυ -w ͰθϩຒΊͱ͔Ͱ͖Δ • {1..10}Έ͍ͨͳهड़ʢݺͼํෆ໌ʣ • {a..z}ͱ͔Ͱɺঢॱɾ߱ॱͰ͑Δ
࿈൪ϑΝΠϧ࡞Γ͍ͨ for i in $(seq -w 1 1 100); do
touch file_$i.txt; done
ຊͳ͢͜ͱ ϫϯϥΠφʔͰTIFMM͠Α͏ FNBDT͔ΒTIFMMΛ͏͍͔ͭ͘ͷํ๏
ͳͥemacsʁ • emacs͕͖͔ͩΒ • shellͷૢ࡞σϑΥϧτͰemcasΩʔόΠϯυ • vimͬͯͯɺshellૢ࡞ͦͷ··͍͡Δਓଟ͍
emacs + shell • emacsͷ্ʹ͍ͯɺshell͍͍ͨͱ͖͋Δ • σΟϨΫτϦͭͬͨ͘Γͱ͔ɺϑΝΠϧૢ࡞ͱ͔ • diredҰ୴͓͍͓ͯ͜͏ •
IDEҰ୴͓͍͓ͯ͜͏
ผλʔϛφϧ
• CTRL + z Ͱbackgroud • γϯάϧΟϯυͰͰ͖Δ • emacsͰϠϯΫͨ͠จࣈྻ ͔ͭͬͯshell͍͍ͨ
• λʔϛφϧͰͷίϐϖͳ͊ • tmux/screen͔ͭ͏ͷͳ͊ -nwݶఆ background
• ୯ൃར༻ͳΒ͜Ε͕ศར • scriptॻ్͍ͯͯதͰ࣮ߦͨ͠ Γ͍ͨ͠ͱ͖ͱ͔ • ͔ͨ͠ඪ४Ͱ͑ͨͣ M-! shell-command
• elispͰ࣮͞ΕͯΔshell • lsίϚϯυͳΒɺem-ls.el͕ݺ Ε͍ͯΔ • ͍͘͢͝ʹ͍͘͠ɺ͋͑ͯ Θͳ͍͍ͯ͘ͱࢥ͏ • ศརͳ͍ํ͋Δͷ͔ͳɾɾɾ
M-x eshell
• Լ෦ʹshellઐ༻Οϯυ͕ ग़ͯ͘Δ • F6ʹׂΓͯͯɺදࣔɾඇද ࣔΛτάϧͤͯ͞Δ • ඞཁͳͱ͖͚ͩʹ͔ͭ͑Δͷ Ͱ͘͢͝ศར shell-pop.el
ຊͷ·ͱΊ • ϫϯϥΠφʔͰॻ͘ͱ͍Ζ͍ΖḿΔ • ͱ͘ʹforศརͳͷͰखบʹͳΔͱ͍͍ײ͡ • emacsͷ͕ଟͯ͘͢Έ·ͤΜ
None