1

I am writing a shell script which uses curl(1) to download files. By default curl will set a HTTP User-Agent (UA) to something like curl/7.74.0. I want to be a good internet citizen and set the UA to say what my script is. Since the software that is making HTTP requests is still curl, I would like this user agent to also include the default curl UA.

I can replace User-Agent with -A, but is it possible to add something to the default curl UA? Is there an argument to prefix/suffix my text to what curl would normally send? (e.g. curl --append-to-ua ' mysoftware/1.0' … results in User-Agent: curl/7.74.0 mysoftware/1.0 http header)

(curl v7.74.0 installed via apt on debian 11)

Amandasaurus
  • 30,211
  • 62
  • 184
  • 246

0 Answers0