LoginSignup
0
0

More than 5 years have passed since last update.

sed,正規表現で取り出した文字列(随時更新)

Last updated at Posted at 2019-01-04

タイトルどおり、sedや正規表現を利用して抽出した文字列を備忘録としてまとめていきます。正規表現やシェルに強くはないため、非効率な書き方もあるかもしれません。よりよい書き方がありましたらご指摘いただけますと幸いです。

php.iniのパス

$ php --ini | sed -n 2p | sed -e "s/^Loaded.*\ //g

phpのextension_dirのパス

$ php -i | grep extension_dir | sed -e "s/^extension_dir\ =>[^=]*=>\ //g" | sed -n 1p

特定ユーザの所属グループ一覧

$ echo `id vagrant` | sed -e 's/[0-9\(,\ ]//g'| sed -e 's/)/\n/g' > vagrant_group.txt
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0