How to get output from standard error in command line?

I'm trying to run some external command line program in Mathematica, and I have problem getting the output.

For example,

Import["!echo hello world\nexit\n", "Text"]
(*"hello world"*)


run echo and get the output.

However this doesn't work for me

Import["!g++ -v", "Text"]


I only get an empty line.

In version 10, there is the RunProcess function which seems to work