Actions
Feature #16741
openImplement Shellwords.shellescape correctly for Windows
Status:
Open
Assignee:
-
Target version:
-
Description
shellwords
module was originally designed and developed for *NIX, and currently works like this:
require 'shellwords'
Shellwords.shellescape("/home/me/test with space.txt")
# => "/home/me/test\\ with\\ space.txt"
Shellwords.shellescape("C:\Program Files")
# => "C:Program\\ Files"
I think it's a good opportunity to extend it to support Windows. According to [2], it looks like using quotations is the only option for paths used in a batch script that have space inside. I propose:
Shellwords.shellescape("C:\Program Files")
# => "\"C:\Program Files\""
Links
Actions
Like0
Like0Like0Like0Like0