9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rubyワンライナーのメモ

Last updated at Posted at 2014-06-17

Rubyワンライナーを実行する

ruby -e "puts 'Hello world.'"

ライブラリを読み込む

http://www.yahoo.co.jp を読み込んでHTMLを出力する。

ruby -r "open-uri" -e "open('http://www.yahoo.co.jp') {|f| puts f.read}"

メモ

eオプションについて

-e 'command' one line of script. Several -e's allowed. Omit [programfile]

「one line of script」を直訳すると「スクリプトの1行」。
以降をスクリプトとして実行する、みたいな意味だと思う。

rオプションについて

-rlibrary require the library before executing your script

スクリプトを実行する前に、ライブラリを読み込む。

参考

9
9
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
9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?