Issue #14765 has been updated by Rushyanth (Rushyanth reddy).


Rushyanth (Rushyanth reddy) wrote:
> In console when we write
> 
> ```ruby
> stdin, stdout, stderr, wait_thr = Open3.popen3("cat .*.yml")
> stdout.readlines
> ```
> 
> All the files with names starting with `.` and ending in `.yml` are shown
> But when we do
> 
> ```ruby
> stdin, stdout, stderr, wait_thr = Open3.popen3("cat", ".*.yml")
> stdout.readlines
> ```
> 
> It returns an empty array
> `stderr.readlines` says  `["cat: .*.yml: No such file or directory\n"]`
> Because it is interpreting the string arguments as it is and looking for a file with name `.*.yml` and not interpreting as in the first case.



----------------------------------------
Bug #14765: Arguments passed to Open3.popen3() are not interpreted as wildcards
https://bugs.ruby-lang.org/issues/14765#change-72073

* Author: Rushyanth (Rushyanth reddy)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.3.1
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
In console when we write

```ruby
stdin, stdout, stderr, wait_thr = Open3.popen4("cat .*.yml")
stdout.readlines
```

All the files with names starting with `.` and ending in `.yml` are shown
But when we do

```ruby
stdin, stdout, stderr, wait_thr = Open3.popen4("cat", ".*.yml")
stdout.readlines
```

It returns an empty array
`stderr.readlines` says  `["cat: .*.yml: No such file or directory\n"]`
Because it is interpreting the string arguments as it is and looking for a file with name `.*.yml` and not interpreting as in the first case.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>