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
610
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
データ基盤におけるIaCの重要性とその運用
mtpooh
4
530
#TRG24 / David Cuartielles / Post Open Source
tarugoconf
0
580
技術に触れたり、顔を出そう
maruto
1
150
Alignment and Autonomy in Cybozu - 300人の開発組織でアラインメントと自律性を両立させるアジャイルな組織運営 / RSGT2025
ama_ch
1
2.4k
生成AIのビジネス活用
seosoft
0
110
東京Ruby会議12 Ruby と Rust と私 / Tokyo RubyKaigi 12 Ruby, Rust and me
eagletmt
3
870
タイミーのデータ活用を支えるdbt Cloud導入とこれから
ttccddtoki
1
150
三菱電機で社内コミュニティを立ち上げた話
kurebayashi
1
360
comilioとCloudflare、そして未来へと向けて
oliver_diary
6
450
When Windows Meets Kubernetes…
pichuang
0
300
ドメイン駆動設計の実践により事業の成長スピードと保守性を両立するショッピングクーポン
lycorptech_jp
PRO
12
2.2k
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!座学①
siyuanzh09
0
110
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Scaling GitHub
holman
459
140k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Optimizing for Happiness
mojombo
376
70k
The Cult of Friendly URLs
andyhume
78
6.1k
Being A Developer After 40
akosma
89
590k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
It's Worth the Effort
3n
183
28k
Designing for humans not robots
tammielis
250
25k
Music & Morning Musume
bryan
46
6.3k
Gamification - CAS2011
davidbonilla
80
5.1k
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