5

I frequently have to switch between two different auth token request headers, that I keep in my .curlrc as such:

-H "X-Auth-Token: 12345678-1234"

It would make my life easier, though, if I could just keep both in there, with one of them commented out when I'm using the other. Seemingly there's barely any documentation on how the .curlrc file is parsed, including on how commenting works or if there's any way to comment out lines at all.

1 Answer 1

7

After a bit of trial and error, it seems like .curlrc follows the bash convention of using a hash character for comments:

-H "X-Auth-Token: 12345678-1234"
# -H "X-Auth-Token: asdfasdf-asdf"

The above will only pass the numerical auth token.

Inlining comments is also possible:

-H "X-Auth-Token: 12345678-1234"  # The other token is asdfasdf-asdf

You must log in to answer this question.

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