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
57 58 59 60 61 |
# File 'lib/bio/command.rb', line 57 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 |