るりまサーチ (Ruby 3.2)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.087秒)

別のキーワード

  1. shellwords shellwords
  2. shellwords shellescape
  3. shellwords shelljoin
  4. shellwords shellsplit

ライブラリ

モジュール

検索結果

Shellwords.#shellescape(str) -> String (69340.0)

文字列を Bourne シェルのコマンドライン中で安全に使えるようにエスケープします。

文字列を Bourne シェルのコマンドライン中で安全に使えるようにエスケープします。

@param str エスケープの対象となる文字列を指定します。
@return エスケープされた文字列を返します。

例:
require 'shellwords'

pattern = 'Jan 15'
puts "grep #{Shellwords.shellescape(pattern)} file"
# => grep Jan\ 15 file