R
R.. Kumar
I download the page http://www.ruby-forum.com/forum/4 using wget. Then i
cat the file and pipe to gsub.
I get: -e:1:in `gsub': invalid byte sequence in US-ASCII (ArgumentError)
wget -q -k -O index11.html http://www.ruby-forum.com/forum/4
cat index11.html | ruby -pe 'gsub(/href=a\/"/,"href=\"'${base}'")' >
ofile
(The value of base is http://www.ruby-forum.com/)
So what must i do so this command can run. It runs fine with another
site.
If i replace ruby with perl -pe 's|....|g' that works fine.
I actually run this in a loop with various URLS from cron.
cat the file and pipe to gsub.
I get: -e:1:in `gsub': invalid byte sequence in US-ASCII (ArgumentError)
wget -q -k -O index11.html http://www.ruby-forum.com/forum/4
cat index11.html | ruby -pe 'gsub(/href=a\/"/,"href=\"'${base}'")' >
ofile
(The value of base is http://www.ruby-forum.com/)
So what must i do so this command can run. It runs fine with another
site.
If i replace ruby with perl -pe 's|....|g' that works fine.
I actually run this in a loop with various URLS from cron.