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
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
74
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
99
あなたの知らないバージョン命名規則
sat
PRO
3
910
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
66
Machine Check Exception
sat
PRO
2
67
バイナリダンプの模様を読む
sat
PRO
0
92
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
92
114-ファイルのshallow_copy.pdf
sat
PRO
2
59
113-Btrfsのスナップショット.pdf
sat
PRO
0
42
Other Decks in Technology
See All in Technology
可視化から始めたAI駆動開発_ochi_ver1.01 / AI-Driven Development Starting with Visualization_ver1.01
yayoi_dd
0
110
Snowflake Horizon Catalog と Apache Iceberg で作る オープンなデータ基盤
kitagawaz
0
350
Argo CDとAtlantisで実現するインフラ管理のセルフサービス化──小規模SREチームで支えるプラットフォーム
cassius7
0
250
【データ横丁主催】AI Agentがコンテキストを使って仕事をした後、何が残るのか― 組織の経験を次の判断に引き継ぐ「Agent Memory」
shisyu_gaku
2
280
[Kiro Meetup #7] Kiro Crew Dive Deep
konippi
0
430
AWS DevOps Agent スキルをつかいこなそう / Master AWS DevOps Agent Skills
kinunori
2
640
顧客の成果創出とプロダクトの成長を 両立するためのFDE
sansantech
PRO
0
520
キャリアLT今日までそして明日から
kentapapa
1
130
1人アドミンな私はAWSアカウント申請をSlackで完結したい!
ysuzuki
0
100
Lambda MicroVMsが分からなすぎたので使い所を1から考えてみた
tsukuboshi
1
260
20260930_Gemma4_Hands-on
tsho
0
180
Account Factory for Terraformによる 標準化されたアカウント発行の自動化
pensuke628
0
120
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
420
Documentation Writing (for coders)
carmenintech
77
5.5k
Building Adaptive Systems
keathley
44
3.2k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
From π to Pie charts
rasagy
1
380
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
390
Game over? The fight for quality and originality in the time of robots
wayneb77
1
290
Evolving SEO for Evolving Search Engines
ryanjones
0
300
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
WENDY [Excerpt]
tessaabrams
14
40k
Transcript
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/