From: Bob Ford Date: 2013-03-09T04:14:54+09:00 Subject: Re: telnet - how to loop through commands listed in a file unknown wrote in post #1100737: > Am 08.03.2013 17:54, schrieb Bob Ford: >> I've now run into a little conundrum. There is one command that can >> take up to 15 seconds to complete so I attempted to put in a simple "if" >> >> ========== snippet ========== >> if #{line} == 'w s' > > You want: if line == 'w s' > > #{line} only makes sense in a double quoted string, > without quotes you are starting a comment here! > > I think you should read up on some basic Ruby syntax, > try e.g. http://pine.fm/LearnToProgram/. > > Generally, placing puts statements like 'puts your_var.inspect' > or 'p your_var' just before "critical" places in your code could > help you understand what's going wrong. > > And you should develop a habit of testing (simplified) code > snippets with irb. Yes I see I've forgotten the quotes. I had inadvertently stripped them off trying different things. I've read and googled and I know I'm horrible at Ruby. I only posted here as a last resort. Nothing I have attempted has worked. I know I'm missing something very simple and hoped someone here might have been able to point me in the correct direction. Please forgive my ignorance and please forgive my asking for help on the forum. It'll not happen again. -- Posted via http://www.ruby-forum.com/.