ç¶ããæ¸ãã¾ããã å°ãåã«akrããããããã£ããããã§ç¥ã£ã Shellwords ã¨ããã¢ã¸ã¥ã¼ã«ã便å©ã ã£ãã®ã§ç´¹ä»ãã¾ãã Rubyã¹ã¯ãªããããã·ã§ã«ã«ã³ãã³ããæãè¾¼ãã¨ãã«å¿ è¦ãªãã¨ã代ããã«ãã£ã¦ããããããã¤ã§ãã module Shellwords (Ruby 2.2.0) ã¤ã³ã¹ãã¼ã« æ¨æºæ·»ä»ãªã®ã§requireããã°ããã«ä½¿ãã¾ãã require 'shellwords' åé¡ ã³ãã³ãããå¼æ°ãåãåã£ã¦lsããã¹ã¯ãªãããèãã¦ã¿ã¾ãã require 'shellwords' system("ls #{ARGV[0]}") ã ãããã®ã±ã¼ã¹ã¯ããã§ããã®ã§ãããå¼æ°ã«ç©ºç½å ¥ãã®ãã¡ã¤ã«ã渡ãããã¨ããªã©ã«åé¡ãèµ·ãã¾ãã $ ruby ls.rb "foo bar.txt" # foo\ bar.txt ã§ãåæ§ ls: bar.txt: No such
{{#tags}}- {{label}}
{{/tags}}