I have:
info = `curl -s http://www.{insertwebsitehere}.com`
followed by some more arguments and I want to suppress everything that gets printed to the terminal. i know that -s
got rid of the progress bar but I can't figure out how to completely remove ALL output of the cURL command.
This command gets run many times during the execution of the program and the output it produces messes everything up.
From what I understand there is no argument which removes it all and i have to redirect it, i just can't figure out how.
I've tried adding > /dev/null/
to the end of it but it gave me errors
any ideas?
thanks
You can suppress stderr by adding 2>/dev/null
:
info = `curl -s http://www.{insertwebsitehere}.com 2>/dev/null`
but better way is to use some http library and fetch your page without starting additional process in a shell. For example there's curb
- libcurl bindings for ruby