Hi everyone, sorry for bad English. Can anybody ask why there is an error? require ''shellwords'' a = [''ok_привет'', ''fail_мистика''] a.each do |s| `touch #{s}` `cat #{s}` `tr -d ''\r'' < #{s}` `tr -d ''\r'' < #{s.shellescape}` end sh: cannot open fail_ми�тика: No such file sh: cannot open fail_ми�тика: No such file -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
s = "мистика" `touch #{s}` `cat #{s}` `cat < #{s}` Result fails. WTF. Why? On 28 дек, 15:09, woto <oga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi everyone, sorry for bad English. > Can anybody ask why there is an error? > > require ''shellwords'' > > a = [''ok_привет'', ''fail_мистика''] > > a.each do |s| > `touch #{s}` > `cat #{s}` > `tr -d ''\r'' < #{s}` > `tr -d ''\r'' < #{s.shellescape}` > end > > sh: cannot open fail_ми тика: No such file > sh: cannot open fail_ми тика: No such file-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
FWIW this works for me (I needed to specify encoding): # encoding: ISO8859-5 s = "мистика" `touch #{s}` `cat #{s}` `cat < #{s}` This is with Ruby 1.9.2p80. Are you still getting a "No such file" error? Could it be a permission issue? On Dec 28, 7:59 am, woto <oga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> s = "мистика" > > `touch #{s}` > `cat #{s}` > `cat < #{s}` > > Result fails.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
no, permissions are ok woto@woto-work:/tmp$ ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] woto@woto-work:/tmp$ uname -a Linux woto-work 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 10:14:11 UTC 2010 x86_64 GNU/Linux woto@woto-work:/tmp$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 10.04.1 LTS Release: 10.04 Codename: lucid I''ve added on top # encoding: ISO8859-5 or # encoding: UTF-8 still getting error On 28 дек, 16:15, djangst <djan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> FWIW this works for me (I needed to specify encoding): > > # encoding: ISO8859-5 > s = "мистика" > > `touch #{s}` > `cat #{s}` > `cat < #{s}` > > This is with Ruby 1.9.2p80. Are you still getting a "No such file" > error? Could it be a permission issue? > > On Dec 28, 7:59 am, woto <oga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > s = "мистика" > > > `touch #{s}` > > `cat #{s}` > > `cat < #{s}` > > > Result fails.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 28 December 2010 12:09, woto <oganer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi everyone, sorry for bad English. > Can anybody ask why there is an error? > > require ''shellwords'' > > a = [''ok_привет'', ''fail_мистика''] > > a.each do |s| > `touch #{s}` > `cat #{s}` > `tr -d ''\r'' < #{s}` > `tr -d ''\r'' < #{s.shellescape}` > end > > sh: cannot open fail_ми�тика: No such file > sh: cannot open fail_ми�тика: No such fileWhich commands are failing? Have you checked the others are working as expected. It would be better to reduce the problem to the simplest that fails. Do you need to have the array of strings for example? I suggest you reduce the example to the simplest code that fails and re-post that. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
More over for example this works good s = "работает" `touch #{s}` `cat #{s}` `cat < #{s}` Problem is only when Russian symbol ''с'' in the word On 28 дек, 16:39, woto <oga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> no, permissions are ok > > woto@woto-work:/tmp$ ruby -v > ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] > > woto@woto-work:/tmp$ uname -a > Linux woto-work 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 10:14:11 > UTC 2010 x86_64 GNU/Linux > > woto@woto-work:/tmp$ lsb_release -a > No LSB modules are available. > Distributor ID: Ubuntu > Description: Ubuntu 10.04.1 LTS > Release: 10.04 > Codename: lucid > > I''ve added on top > # encoding: ISO8859-5 > or > # encoding: UTF-8 > still getting error > > On 28 дек, 16:15, djangst <djan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > FWIW this works for me (I needed to specify encoding): > > > # encoding: ISO8859-5 > > s = "мистика" > > > `touch #{s}` > > `cat #{s}` > > `cat < #{s}` > > > This is with Ruby 1.9.2p80. Are you still getting a "No such file" > > error? Could it be a permission issue? > > > On Dec 28, 7:59 am, woto <oga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > s = "мистика" > > > > `touch #{s}` > > > `cat #{s}` > > > `cat < #{s}` > > > > Result fails.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
As i told. The problem arise when the command contains ''<'' and Russian symbol ''с'' On 28 дек, 16:54, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 28 December 2010 12:09, woto <oga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > Hi everyone, sorry for bad English. > > Can anybody ask why there is an error? > > > require ''shellwords'' > > > a = [''ok_привет'', ''fail_мистика''] > > > a.each do |s| > > `touch #{s}` > > `cat #{s}` > > `tr -d ''\r'' < #{s}` > > `tr -d ''\r'' < #{s.shellescape}` > > end > > > sh: cannot open fail_ми тика: No such file > > sh: cannot open fail_ми тика: No such file > > Which commands are failing? Have you checked the others are working > as expected. It would be better to reduce the problem to the simplest > that fails. Do you need to have the array of strings for example? > > I suggest you reduce the example to the simplest code that fails and > re-post that. > > Colin-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I tried the same example I posted above with 1.8.7 (2009-06-12 patchlevel 174) and it works there too, without the encoding specified (that all changed between 1.8 and 1.9 AFAIK). The post title mentioned the console. Are you running from the command line, IRB, Rails console...? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I have a difficulties with an explanation of problem. I asked this question also on stackoverflow. May be English speaking developers will help me with explanation. Because one developer also confirmed this problem. http://stackoverflow.com/questions/4546285/problem-with-cyrillic-symbols-in-console On 28 дек, 17:10, djangst <djan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I tried the same example I posted above with 1.8.7 (2009-06-12 > patchlevel 174) and it works there too, without the encoding specified > (that all changed between 1.8 and 1.9 AFAIK). > > The post title mentioned the console. Are you running from the command > line, IRB, Rails console...?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.