Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
String#shellescape
() -> ::String
str.shellescape => string
lib/shellwords.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/shellwords.rb, line 238
def shellescape
Shellwords.escape(self)
end
Escapes str so that it can be safely used in a Bourne shell command line.
See Shellwords.shellescape for details.