diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-09-16 11:45:43 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-09-17 22:05:58 +0900 |
commit | 72772a3caa16fd240aa1e9c9432e2d6492c0b0ac (patch) | |
tree | 43429aea7910f3193a15a1a4484b018ce63ee49a /io.c | |
parent | 2dffd365048d48e4d8da8bd77a023f87d7266e9f (diff) | |
download | ruby-72772a3caa16fd240aa1e9c9432e2d6492c0b0ac.tar.gz |
[DOC] Mention "-" in ARGF
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -14625,11 +14625,16 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y) * ARGV.replace ["file2", "file3"] * ARGF.read # Returns the contents of file2 and file3 * - * If +ARGV+ is empty, ARGF acts as if it contained STDIN, i.e. the data - * piped to your script. For example: + * If +ARGV+ is empty, ARGF acts as if it contained <tt>"-"</tt> that + * makes ARGF read from STDIN, i.e. the data piped or typed to your + * script. For example: * * $ echo "glark" | ruby -e 'p ARGF.read' * "glark\n" + * + * $ echo Glark > file1 + * $ echo "glark" | ruby -e 'p ARGF.read' -- - file1 + * "glark\nGlark\n" */ /* |