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
I could be Wrong!! - Learning from Agile Experts
kawaguti
PRO
8
3.4k
Git scrapingで始める継続的なデータ追跡 / Git Scraping
ohbarye
5
490
dbtを中心にして組織のアジリティとガバナンスのトレードオンを考えてみた
gappy50
0
230
JAWS-UG20250116_iOSアプリエンジニアがAWSreInventに行ってきた(真面目編)
totokit4
0
140
Visual StudioとかIDE関連小ネタ話
kosmosebi
1
370
embedパッケージを深掘りする / Deep Dive into embed Package in Go
task4233
1
210
【JAWS-UG大阪 reInvent reCap LT大会 サンバが始まったら強制終了】“1分”で初めてのソロ参戦reInventを数字で振り返りながら反省する
ttelltte
0
140
AWS re:Invent 2024 recap in 20min / JAWSUG 千葉 2025.1.14
shimy
1
100
AWSサービスアップデート 2024/12 Part3
nrinetcom
PRO
0
140
Unsafe.BitCast のすゝめ。
nenonaninu
0
200
Azureの開発で辛いところ
re3turn
0
240
KMP with Crashlytics
sansantech
PRO
0
240
Featured
See All Featured
The Language of Interfaces
destraynor
155
24k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
For a Future-Friendly Web
brad_frost
176
9.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
210
The Power of CSS Pseudo Elements
geoffreycrofte
74
5.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
360
A better future with KSS
kneath
238
17k
How STYLIGHT went responsive
nonsquared
96
5.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Why Our Code Smells
bkeepers
PRO
335
57k
The Invisible Side of Design
smashingmag
299
50k
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