How do I pipe or redirect the output of curl -v?

后端 未结 8 1938
挽巷
挽巷 2021-01-29 21:17

For some reason the output always gets printed to the terminal, regardless of whether I redirect it via 2> or > or |. Is there a way to get around this? Why is this happening?

8条回答
  •  北恋
    北恋 (楼主)
    2021-01-29 21:59

    The following worked for me:

    Put your curl statement in a script named abc.sh

    Now run:

    sh abc.sh 1>stdout_output 2>stderr_output
    

    You will get your curl's results in stdout_output and the progress info in stderr_output.

提交回复
热议问题