ccat: curl cat
I was working on a script which accepted both local file paths and remote URLs, and if it was remote, it would
HTTP GET
the file contents.
I soon again found the need to use this functionality - to accept a list of files, some local, some remote - and read the contents from all of them alike.
It was at this time that I threw together
ccat
(curl cat) - a small
Golang
script which acts like
cat
, but will also
HTTP GET
the contents of remote files (hence the "curl" moniker!).
Options:
ccat [options] [file/url ...]
-H value
Headers to send when requesting remote resources
-b string
Body to send when requesting remote resources
-c value
Cookies to send when requesting remote resources
-m string
Method when requesting remote resources (default "GET")
-u string
Basic auth to send when requesting remote resources
A Note on the Name
At this point, "curl-cat" is probably a bit of a stretch. This script does not have all the power that curl does - currently, it can simply GET a remote resource and that's it.
The name was admittedly chosen because it rolled off the toung well, gave a broad idea of the usage, and was "cute". Sorry. I aim to add more features to the script to make it more "curl-like". Pull requests are always welcome.
codelast updated 2024-03-18