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
awk basics
Search
yammerjp
May 22, 2023
Programming
1
460
awk basics
awkの使い方を紹介します。
競プロもくもくわいわい会 2023/05/22
yammerjp
May 22, 2023
Tweet
Share
More Decks by yammerjp
See All by yammerjp
生成AIとの対話から、概念をみつけ、名前をつける / Name it with generative AI
yammerjp
2
1.6k
awkでつくってわかるWebアプリケーション / Web Application Implementation in awk
yammerjp
14
8.3k
jpro: JSON Processor
yammerjp
0
520
クイズを作ってPHPに親しむ / Make quizzes and get familiar with PHP
yammerjp
2
1.5k
dotfilesを管理しよう / get-started-with-dotfiles-management
yammerjp
0
1.1k
比較演算を壊してみる / php-break-comparison
yammerjp
1
1.1k
切り取り方を工夫してアプリケーションを漸進的に改善する / Incremental improvement by devising application change boundaries
yammerjp
1
1.7k
社用PCのdotfiles管理 / dotfiles-in-company
yammerjp
1
2.4k
開発チームの新しいエンジニアメンバーがうまくやるには / newcomer-in-development-team
yammerjp
0
1.7k
Other Decks in Programming
See All in Programming
良いユニットテストを書こう
mototakatsu
8
2.6k
情報漏洩させないための設計
kubotak
2
290
Exploring: Partial and Independent Composables
blackbracken
0
100
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
260
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
テストコード書いてみませんか?
onopon
2
130
MCP with Cloudflare Workers
yusukebe
2
220
From Translations to Multi Dimension Entities
alexanderschranz
2
130
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
820
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
103 Early Hints
sugi_0000
1
230
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Optimizing for Happiness
mojombo
376
70k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
A designer walks into a library…
pauljervisheath
204
24k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Making Projects Easy
brettharned
116
5.9k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Why Our Code Smells
bkeepers
PRO
335
57k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
BBQ
matthewcrist
85
9.4k
Transcript
தࢁܚ༞ Μ·ʔ BXLCBTJDT ڝϓϩ͘͘Θ͍Θ͍ձ
தࢁܚ༞ w ৬ۀ8FCΞϓϦέʔγϣϯ ΤϯδχΞ ʙ w झຯEPU fi MFTͷཧ
w झຯBXLΛॻ͘͜ͱ w 5XJUUFS(JU)VCZBNNFSKQ Μ·ʔ
BXL ςΩετॲཧʹಛԽͨ͠ϓϩάϥϛϯάݴޠ
BXL ඪ४ೖྗΛѻ͏ͷ͕ಘҙ
BXL ڝٕϓϩάϥϛϯάΓ͍͢
࣮༻తͳBXLͷ͍ํ
ྫBQBDIFͷΞΫηεϩά͔Β*1ΞυϨεΛൈ͖ग़͢ ʜۭന۠Γͷ൪ͷϑΟʔϧυ
ྫBQBDIFͷΞΫηεϩά͔Β*1ΞυϨεΛൈ͖ग़͢ ʜۭന۠Γͷ൪ͷϑΟʔϧυ cat access.log | awk ‘{ print $1
}’ | head -3 ʜۭന۠Γͷ൪ͷϑΟʔϧυ
BXLͷϢʔεέʔεͷҎ্͜Ε ӕͩͱࢥͬͨ͋ͳͨɺ4MBDLΛʮBXLʯͰݕࡧͯ͠ΈΔͱ͍͍Ͱ͢
BXLͷॻ͖ํ
جຊจ๏ ɹɹɹɹɹɹɹɹɹύλʔϯ\ΞΫγϣϯ^ ɾύλʔϯ͕Ұக͢ΔߦʹɺΞΫγϣϯΛ࣮ߦ ɾύλʔϯΛলུ͢Δʜਅ શߦʹΞΫγϣϯΛద༻ ɾΞΫγϣϯΛলུ͢Δʜ\QSJOU^ ߦશମΛग़ྗ
ಛघͳม ඪ४ೖྗͷߦશମ ʜۭന۠ΓͷO൪ͷϑΟʔϧυ /'ϑΟʔϧυ /3ݱࡏͷߦ൪߸
<4FQ >(&5XQ DBU)551ʜུ <4FQ >(&5TDSJQUJOHKBWBIUNMʜུ <4FQ >(&5XQ TSBTQCFSSZ Qʜུ
/' /3 ಛघͳม
<4FQ >(&5XQ DBU)551ʜུ <4FQ >(&5TDSJQUJOHKBWBIUNMʜུ <4FQ >(&5XQ TSBTQCFSSZ Qʜུ
/' /3 ಛघͳม
<4FQ >(&5XQ DBU)551ʜུ <4FQ >(&5TDSJQUJOHKBWBIUNMʜུ <4FQ >(&5XQ TSBTQCFSSZ Qʜུ
/' /3 ಛघͳม
ྫߦͷ*1ΞυϨεΛग़ྗ NR==33 { print $1 }
ྫ֤ߦͷۮྻͷϑΟʔϧυΛग़ྗ { for(i=1; i<=NF; i++) { if(i%2==0) {
if(i!=1) { printf(“ “) } printf(“%s”, $i) } } printf(“\n”) } IUUQTHJTUHJUIVCDPNZBNNFSKQEECBBFGCEFDEB
ྫ"#$ $0=$(gsub(_,FS)/2) ɾʮʹೖ͢Δʯͱ͍͏ύλʔϯ㱺ਅ ɾਅͳͷͰɺΛग़ྗ ˠʮQSJOUʯͱॻ͘ͱ͜ΖΛɺʮʯͱॻ͍ͯจࣈઅ IUUQTHJTUHJUIVCDPNZBNNFSKQDEBCFCGEDG
εϥΠυதͷBDDFTTMPHɺॻ੶ʮϚελϦϯά-JOVYγΣϧεΫϦϓτʯͷαϯϓϧίʔυΛ༻͍ͯ͠·͢ IUUQTHJUIVCDPNPSFJMMZKBQBONBTUFSJOHMJOVYTIFMMTDSJQUJOHFKBCMPCNBJODIBDDFTTMPH
BXLΛͨͷ͠͏