Hi all ,
I am new to ruby here i need to pass curl command in ruby script
i am getting the error mesage
require ‘rubygems’
array1=[ “google.com” , “yahoo.com” ]
hello = curl #array1[1]
puts hello
D:\Documents and Settings\curl\curl>ruby test1.rb
curl: (3) [globbing] error: bad range specification after pos 9
kalyan m. wrote in post #1009116:
Hi all ,
I am new to ruby here i need to pass curl command in ruby script
i am getting the error mesage
require ‘rubygems’
array1=[ “google.com” , “yahoo.com” ]
hello = curl #array1[1]
puts hello
D:\Documents and Settings\curl\curl>ruby test1.rb
curl: (3) [globbing] error: bad range specification after pos 9
Change this to
hello = echo curl #array1[1]
or
puts “curl #array1[1]”
and you’ll see what the problem is. (Hint: you’re using the wrong syntax
for interpolating an expression into a string)
Trying this out interactively in irb is a very good way to find out
what’s happening.