I am trying to send the output of a curl request to a file using regular-expression.

curl -k -v -x x.x.x.x:x https://repo.nagios.com/nagios/7/repodata/repomd.xml > curl1

Using the above syntax only writes the output of the request to the file but I would like to see both the setup portion and the output of the curl written to the file.

I know that I could use putty to log all output of the shell but I am specifically looking for a bash solution.

  • Most likely the "setup portion" is emitted to stderr, so you'd do ... > output.file 2>&1 Jan 8, 2021 at 18:09

1 Answer 1

echo "curl -k -v https://www.google.com" >> curl1;  curl -k -v https://www.google.com >> curl1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .