From: nobu@... Date: 2015-12-31T12:52:31+00:00 Subject: [ruby-core:72637] [Ruby trunk - Bug #11915] File.read reading string starting with | executes it. Issue #11915 has been updated by Nobuyoshi Nakada. Description updated Linus Sellberg wrote: > It is one thing that some of the `.open` methods actually can execute stuff, but a method named 'read' should not behave like that. `File.open` does not. Some class methods of `IO`, e.g. `IO.foreach` and `IO.read`, deal with a pipeline. Seems a documentation issue. ---------------------------------------- Bug #11915: File.read reading string starting with | executes it. https://bugs.ruby-lang.org/issues/11915#change-55889 * Author: Linus Sellberg * Status: Open * Priority: Normal * Assignee: * ruby -v: 2.1.5p273 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- ```ruby puts File.read "|/bin/ls" [output of executing ls] => nil ``` This is quite surprising behaviour. It is one thing that some of the `.open` methods actually can execute stuff, but a method named 'read' should not behave like that. -- https://bugs.ruby-lang.org/ Unsubscribe: