curl / Mailing Lists / curl-users / Single Mail


Re: curl verbose mode format

From: Thompson, Matt \(GSFC-610.1\)\[SCIENCE SYSTEMS AND APPLICATIONS INC\] via curl- <>
Date: Mon, 22 Jan 2018 07:17:43 -0500

On 01/22/2018 05:32 AM, Keefe Tang via curl-users wrote:
> Can someone explain why when I try capturing the verbose output to a
> shell variable, I get the following result and how I can capture the
> same output as I see in terminal?
> $ req=$( curl -svo /dev/null 2>&1 ); echo $req

This might be a bash-ism. Try doing:

   echo "$req"

instead. I think the redirect plus echo without quoting will suppress


Matt Thompson, SSAI, Sr Scientific Programmer/Analyst
NASA GSFC,    Global Modeling and Assimilation Office
Code 610.1,  8800 Greenbelt Rd,  Greenbelt,  MD 20771
Phone: 301-614-6712                 Fax: 301-614-6246
Received on 2018-01-22