command line - Ruby commandline program exit then message appears -
command line - Ruby commandline program exit then message appears -
trying write ruby command line interface. when programme exits, message appear.
here program:
require 'open-uri' url = argv[0] if url.nil? abort "no url provided" end begin puts open(url) rescue => e abort e.message end
i following
> ruby -ilib bin/command http://iservice.ltn.com.tw/2014/specials/nonukes/news.php?rno=1&type=l&no=998123 [1] 8642 [2] 8643 [2]+ done type=l > #<stringio:0x007fdf96ac82f8> [1]+ done ruby -ilib bin/command http://iservice.ltn.com.tw/2014/specials/nonukes/news.php?rno=1&type=l&no=998123 >
as can see, unusual lines appears first such [1] 8642
, programme exits. , after sec shell prints out #<stringio:0x007fdf96ac82f8>
, , hangs there. have press come in in order exit program.
update seems happens url such the 1 listed in example.
why programme exits print result, , hangs? unusual log messages?
i guess passing url query string.
quote url in command line
ruby command-line open-uri
Comments
Post a Comment