From: "ifiht (Mikal R)" Date: 2022-11-19T22:45:35+00:00 Subject: [ruby-core:110821] [Ruby master Bug#19130] MRI failing when executing shell builtin commands with Errno::ENOENT Issue #19130 has been updated by ifiht (Mikal R). Is there a ruby-specific list then of what gets implemented? Seems like `type` is both included in the POSIX spec (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/type.html) and the Bourne Shell, but not Ruby: ``` ���$ /bin/sh -c "type type" type is a shell builtin ``` mjrzasa (Maciek Rz��sa) wrote in #note-2: > I've reproduced it on MRI 2.7.0, but not for all built-ins, just ones that are Bash-specific as per these lists: > * https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Builtins.html (these work) > * https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html (these fail) > > ``` > [3] pry(main)> %x(type ls) > Errno::ENOENT: No such file or directory - type > from (pry):3:in ``' > [4] pry(main)> %x(pwd) > => "/home/mrzasa\n" > [5] pry(main)> %x(return) > => "" > [6] pry(main)> %x(alias) > Errno::ENOENT: No such file or directory - alias > from (pry):6:in ``' > > ``` ---------------------------------------- Bug #19130: MRI failing when executing shell builtin commands with Errno::ENOENT https://bugs.ruby-lang.org/issues/19130#change-100178 * Author: ifiht (Mikal R) * Status: Open * Priority: Normal * ruby -v: 3.2.0 * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Sorry if this came up already, Google & Redmine came up blank but maybe I missed it. Bug was found on 3.0.0 but I tested on 3.2.0-preview1 and it's present on both. Trying to execute any shell builtin commands from irb or script fails with `No such file or directory - (Errno::ENOENT)` ``` ���$ rvm list * ruby-3.0.0 [ x86_64 ] => ruby-3.2.0-preview1 [ x86_64 ] ``` MRI 3.0.0: ``` 3.0.0 :001 > %x(type ls) Traceback (most recent call last): 5: from /home/ifiht/.rvm/rubies/ruby-3.0.0/bin/irb:23:in `
' 4: from /home/ifiht/.rvm/rubies/ruby-3.0.0/bin/irb:23:in `load' 3: from /home/ifiht/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb:11:in `' 2: from (irb):1:in `
' 1: from (irb):1:in ``' Errno::ENOENT (No such file or directory - type) 3.0.0 :002 > %x(cd /home/ifiht) Traceback (most recent call last): 6: from /home/ifiht/.rvm/rubies/ruby-3.0.0/bin/irb:23:in `
' 5: from /home/ifiht/.rvm/rubies/ruby-3.0.0/bin/irb:23:in `load' 4: from /home/ifiht/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb:11:in `' 3: from (irb):1:in `
' 2: from (irb):2:in `rescue in
' 1: from (irb):2:in ``' Errno::ENOENT (No such file or directory - cd) 3.0.0 :003 > exit ``` MRI 3.2.0: ``` :001 > %x(type ls) (irb):1:in ``': No such file or directory - type (Errno::ENOENT) from (irb):1:in `
' from /home/ifiht/.rvm/rubies/ruby-3.2.0-preview1/lib/ruby/gems/3.2.0+1/gems/irb-1.4.1/exe/irb:11:in `' from /home/ifiht/.rvm/rubies/ruby-3.2.0-preview1/bin/irb:25:in `load' from /home/ifiht/.rvm/rubies/ruby-3.2.0-preview1/bin/irb:25:in `
' :002 > `type ls` (irb):2:in ``': No such file or directory - type (Errno::ENOENT) from (irb):2:in `
' from /home/ifiht/.rvm/rubies/ruby-3.2.0-preview1/lib/ruby/gems/3.2.0+1/gems/irb-1.4.1/exe/irb:11:in `' from /home/ifiht/.rvm/rubies/ruby-3.2.0-preview1/bin/irb:25:in `load' from /home/ifiht/.rvm/rubies/ruby-3.2.0-preview1/bin/irb:25:in `
' ``` Assuming this is a bug? Let me know if shell builtins are deliberately excluded for some reason, I'll try to work around it. -- https://bugs.ruby-lang.org/ Unsubscribe: