All of Percona’s open-source software products, in one place, to download as much or as little as you need.
![Release 1.0.1 of Percona Monitoring Plugins](https://cdn-ak-scissors.b.st-hatena.com/image/square/b56e86e78d4cf20ae5da5f8f28fac0531d82e826/height=288;version=1;width=512/https%3A%2F%2Fwww.percona.com%2Fblog%2Fwp-content%2Fuploads%2F2020%2F05%2FBlog_SignUp.jpg)
All of Percona’s open-source software products, in one place, to download as much or as little as you need.
All of Percona’s open-source software products, in one place, to download as much or as little as you need.
grep & awk grep "^HOGEHOGE" file | awk 'BEGIN { FS = "="}; { print $2 }' というコード。一見何も問題ない様に見えるし確かに動作はするが、 CPU とプロセスと時間の無駄遣いである。 awk (1) には拡張正規表現が実装されているで、 awk 'BEGIN{FS="="}/^HOGEHOGE/{ print $2 }' file とすれば grep (1) の分だけ CPU やプロセス、時間が節約できる。 sed -n '/^HOGEHOGE/s/^.*=//p' file とするのも等価かな。 行指向の処理であれば煩雑な awk (1) よりも sed (1) の方が見やすいので、 個人的には sed (1) を利用した方法がお勧め。 シェルスクリプトに限らずスクリプト言語で記述されたプログラムは、 source f
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く