Can i Use the value of a variable from within a ruby script inside ssh.exec()
- by kamal
If i have a # {} , like #{results}, in the snippet below:
results = Array.new
f = open("/Users/kahmed/messages", "r")
f.each_line do |line|
results << "#{$.} #{line}" if line =~ /NFE/
put #{results}
end
How can i use it in the following ssh.exec command
Net::SSH.start( HOST, USER, :password = PASS ) do|ssh|
ssh.exec(#{results})