るりまサーチ

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

別のキーワード

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

ライブラリ

モジュール

検索結果

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

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

...ープします。

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

例:
require 'shellwords'

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