Method: Bio::Command.escape_shell_unix
- Defined in:
- lib/bio/command.rb
.escape_shell_unix(str) ⇒ Object
Escape special characters in command line string for UNIX shells.
Arguments:
-
(required) str: String
- Returns
-
String object
110 111 112 113 114 |
# File 'lib/bio/command.rb', line 110 def escape_shell_unix(str) str = str.to_s raise 'cannot escape control characters' if UNESCAPABLE_CHARS =~ str str.gsub(UNSAFE_CHARS_UNIX) { |x| "\\#{x}" } end |