From: alex mic Date: 2006-04-13T18:57:31+09:00 Subject: Re: Shame on me poorr newbie " unexpected kend" First thank you all for your fast answers. james gray wrote: >That's not a valid Ruby statement. Try: > > store += 1 :) Ex-con (java) habits are hard to loose It fixed the error. unknown wrote: > Hi -- > > On Thu, 13 Apr 2006, alex mic wrote: > >> quest="u" >> while found!=1 >> io = IO.popen("cat /proc/scsi/usb-storage/#{store}", "r+") >> io.close_write >> str = io.read >> while quest!="y" or quest!="n" The loop is indeed infinite, i changed for while !(quest=="y" or quest=="n") Here is the final method :) def finddevice() puts "We are now trying to find the device" found=0 store=0 quest="u" while found!=1 io = IO.popen("cat /proc/scsi/usb-storage/#{store}", "r+") io.close_write str = io.read puts str while !(quest=="y" or quest=="n") puts "This is what is found on /proc/scsi/usb-storage/#{store}. Is it your device [y/n]" quest=gets.chop!.downcase if quest=="y" found=1 @procdata = str else store+=1 end end end end thanks again Regards Alexmic -- Posted via http://www.ruby-forum.com/.