From: Tietew Date: 2003-09-18T20:33:03+09:00 Subject: [ruby-list:38410] Re: バッククォート(`)で囲まれた文字列の扱いが分からない On Thu, 18 Sep 2003 19:10:15 +0900 In article <53D741AC18A5514EBA71321DAF45B4CCE5B4EF@TAIYONET.taiyokogyo.co.jp> [[ruby-list:38409] バッククォート(`)で囲まれた文字列の扱いが分からない] 岩崎 弘孝 wrote: > system("net use \\\\foo\\common") > `net use \\\\foo\\common /delete` #2 ng > > system("net use \\\\foo\\common") > a="net use \\\\foo\\common /delete" > `#{a}` #3 ok 試してみました。 $ irb1.8 irb(main):002:0> def `(s); puts "`: #{s.dump}"; end => nil irb(main):006:0> `net use \\\\foo\\common /delete` #2 `: "net use \\\\\\\\foo\\\\common /delete" => nil irb(main):016:0> `\n` `: "\\\n" irb(main):020:0> `\`` `: "\\\`" なんかおかしいですね これでいいと思えます。 Index: parse.y =================================================================== RCS file: /src/ruby/parse.y,v retrieving revision 1.290 diff -u -2 -p -r1.290 parse.y --- parse.y 17 Sep 2003 11:34:02 -0000 1.290 +++ parse.y 18 Sep 2003 11:18:18 -0000 @@ -2935,5 +2935,5 @@ enum string_type { str_squote = (0), str_dquote = (STR_FUNC_EXPAND), - str_xquote = (STR_FUNC_ESCAPE|STR_FUNC_EXPAND), + str_xquote = (STR_FUNC_EXPAND), str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND), str_sword = (STR_FUNC_QWORDS), —[ Tietew ]—————————————————————————— メ : tietew@tietew.net / tietew@raug.net / tietew@masuclub.net ホペ: http://www.tietew.net/ Tietew Windows Lab. http://www.masuclub.net/ 鱒倶楽部 指紋: 26CB 71BB B595 09C4 0153 81C4 773C 963A D51B 8CAA