Skip to content

Instantly share code, notes, and snippets.

@yucao24hours
Last active October 26, 2016 07:33
Show Gist options
  • Save yucao24hours/efc2401a1c7376f08c15255c56c5ea57 to your computer and use it in GitHub Desktop.
Save yucao24hours/efc2401a1c7376f08c15255c56c5ea57 to your computer and use it in GitHub Desktop.

追記

gem update コマンドに gem 名を渡さずそのまま実行すれば system のすべての gem が対象になる。

http://guides.rubygems.org/command-reference/#gem-update

もともと書いてたこと

cut コマンドは、指定した区切り文字・箇所からのデータを標準出力に表示する。

半角スペースを区切り文字として、hoge.txt の 2 つめのフィールド以降を表示する例:

$ cut -f 2- -d ' ' hoge.txt
hoge aaa
fuga bbb
piyo ccc

2-2 とすると hoge fuga piyo のカラムのみが取れる。

これを応用して、 自分が system にインストールしている gem を全て一度に update する

gem update `gem list | cut -d ' ' -f 1`
foo hoge aaa
bar fuga bbb
baz piyo ccc
@yucao24hours
Copy link
Author

Jekyll がバグってて latest に上げられない問題があった気がするので、あまり安易にはやらないほうがよさそうだとは思う。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment