Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
bashの組み込みコマンドの自作
Search
Satoru Takeuchi
PRO
June 24, 2022
Technology
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
bashの組み込みコマンドの自作
以下動画のテキストです
https://youtu.be/wXgkrMsxYqk
Satoru Takeuchi
PRO
June 24, 2022
Transcript
6 slides
bashの組み込みコマンドを自作 Jun. 24th, 2022 Satoru Takeuchi twitter: satoru_takeuchi
おさらい: bashの組み込みコマンドとは • 📝 過去動画: bashの組み込みコマンドより抜粋 ◦ https://youtu.be/6oVvcnwRUa0 • bash上で”help”を実行すると出てくるコマンドたち
• 新規プロセスを生成せずにbash自身が処理
bashの組み込みコマンドは自作できる • 必要なパッケージ(Ubuntu 20.04を想定) ◦ bash-builtins • 開発言語 ◦ C言語
helloと出力する組み込みコマンドを作る • ソースの場所 ◦ https://github.com/satoru-takeuchi/youtube-sample/tree/master/0042-create-bash-builtin-commands • ビルド方法 ◦ make •
組み込み方法 ◦ enable -f ./myhello.so myhello • 実行ファイル形式のコマンドとの性能比較 ◦ ./bench.sh
組み込みコマンド自作機能についての私見 • 面白いけど、あまり使う場面はなさそう • 性能向上するケースが限られる ◦ コマンド実行コストのほとんどがプロセスの生成コスト ◦ コマンドが大量に呼ばれる •
C言語のソースを書いてメンテするのが面倒 • 使う前にいちいち組み込むのが面倒
まとめ • bashの組み込みコマンドは自作できる • 面白いが使い道は限られる • 📝 興味ある方はbash-builtinsのドキュメントを参照 ◦ /usr/share/doc/bash-builtins/examples/
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
Btrfsのsnapshotとランダム書き込み
sat
PRO
0
51
ファイルシステムのデフラグ
sat
PRO
1
58
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
130
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
90
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
120
あなたの知らないバージョン命名規則
sat
PRO
3
940
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
87
Machine Check Exception
sat
PRO
2
78
バイナリダンプの模様を読む
sat
PRO
0
120
Other Decks in Technology
See All in Technology
アラートを見直していたら営業組織への理解にちょっとだけ繋がった話
z63d
1
210
サーバーラックは作る時代! 3Dプリンターで作る10インチラックのススメ
jacopen
2
480
20261113_JAWS_Osaka
takuyay0ne
1
590
AWS Blocksで AIエージェント作れるの知ってます?
kmiya84377
1
120
Kubernetes, Agones, WebRTC, GPU で作る クラウドゲーミング基盤を本番運用に乗せるまで
vivion
0
170
AWS Emulator を評価する: 手元で動く AWS の API の仕組み、始め方、確かめ方
inariku
PRO
2
780
Terraform 0 to 100:100個以上のリポジトリを常に最新にし続けるための自動化
sue445
2
1.1k
攻撃と守りは何が変わり、何が変わらないのか~最近の不正アクセスから考える、リスク評価と標準の使いどころ
oidfj
2
250
RAGの改善を速く回すための評価基盤
yosukeyoshida
6
3.4k
_マネジメントする人される人ナイト_2026__良いチームを作っていきたい_お気持ち_.pdf
xkxaxkx
0
830
お風呂場をサーバルームにしよう
yusuke427
0
370
自動計装なしでECSサービスをApplication Signalsに載せるまで
ota1022
2
440
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
630
The Invisible Side of Design
smashingmag
301
52k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
580
Un-Boring Meetings
codingconduct
0
500
Git: the NoSQL Database
bkeepers
PRO
433
67k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
320
Highjacked: Video Game Concept Design
rkendrick25
PRO
2
580
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
580
Side Projects
sachag
456
43k
My Coaching Mixtape
mlcsv
0
390