How do I comment out a line in my .curlrc?

2

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.

Underyx

Posted 2014-03-27T10:47:37.297

Reputation: 631

Answers

4

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

Underyx

Posted 2014-03-27T10:47:37.297

Reputation: 631