From the man page.
Use "-C -" to tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out.
Correct me if I’m wrong, but usually “-“ is used (at least in my experience, which is strongly biased towards compilers) as an argument to signify input comes from standard in rather than a file.
Yeah, I get that they're right. I just wanted to share my surprise that curl changes this "convention", though I guess it's to be expected because curl doesn't really take input anyways.
There is nothing particularly special about "-", but a lot of programs do use it for standard input like you said. e.g. awk, cat, diff. My macOS system has a quite a few of these
Working with Windows mainly it always amazes me how powerful the command line tools in Linux are. Most Windows programmers don't know much about command line so downloading some files is a huge affair. If you know curl it's just so easy.
Funny, those of us who enjoy using Windows (esp. Visual Studio) for dev but are aware of how powerful command line tools are find it hard to convince you guys of the reverse in exactly the same way. We don't get the feeling you know what you're missing out on either. ;)
I think you could say Visual Studio Code is to Visual Studio as GIMP is to Adobe Photoshop? Decent, and still useful/handy, but honestly still not even a comparable substitute.
You should try Visual Studio, on Windows if you have to ;) it's not just CLI vs. GUI that I'm talking about, though that's of course a significant part of it too. Eclipse is a GUI too but I still find it painful. (w.r.t. Xcode I've only barely touched it, so hard to compare, but nothing particularly good or bad stood out to me in the little bit I used it.)
I really appreciate your work, it's made my day to day so much better.
You have a true once in a life time opportunity with how badly Apple is screwing the hardware pooch, if your hardware division could put out a laptop to rival the retina Macbook pro with up to date hardware and an excellent command line ecosystem you could very well shift an entire generation away from OsX.
Thanks for all the hard work I'm using Linux for windows right now.
> You have a true once in a life time opportunity with how badly Apple is screwing the hardware pooch, if your hardware division could put out a laptop to rival the retina Macbook pro with up to date hardware and an excellent command line ecosystem you could very well shift an entire generation away from OsX.
As a Linux person that uses Windows on a daily basis, a few things have impressed me lately; Chocolatey[0], VS Code[1] especially w/ Azure integrations[2], and Windows Subsystem for Linux[3]. Things have come a long way....
If you know about the Linux tools things aren't that bad with Windows. My complaint is that a lot of windows devs aren't aware of the command line and its power.
Having to occasionally work with Windows (or more accurately, support people using Windows for tasks that would much better be suited by Linux) makes me aghast at how bad its CLIs are at very basic interface things.
People who work extensively in Windows environments tell me that Powershell is very, well, powerful, and I'm sure it is for certain select use cases of interacting with Windows' internals. But it's baffling, however, how completely incapable it is of handling basic things like sane, well-explained escaping behavior.
I've attempted to find explanations for how people using Powershell should properly escape JSON (either for sending to HTTP APIs or for setting JSON environment variables when using Docker for Windows) and have concluded that it's basically impossible, as the escaping behavior is so different from *nix shells and appears to be documented nowhere.
Supporting it is further complicated by lack of readily available test environments: even if I wasn't running Linux myself, spinning up a VM is free because there's no software license. This isn't the case with OS X, but I can at least assume that OS X bash works the same as Linux bash for 99% of things. Powershell is completely alien and I know of no free way to try it--maybe Azure provides some variant on their free tier, but I haven't looked into it much (my overall experience trying out Azure was that it was a dumpster fire to be avoided at all costs unless you need cloud AD, in which case it's probably amazing).
You can escape things with `. So "{`"foo`": `"an \`"escaped \`" value`"}". Or because powershell has types and objects you can just use native objects and hashes, then pipe it to `ConvertTo-Json` when you need a string.[0]
> Powershell is completely alien and I know of no free way to try it
Powershell is opensource and cross-platform as of last year. [1] Though its still definitely windows first.
httpie lacks a complete feature set in some cases, though day-to-day it's much nicer. I'll trade cURL's (admittedly clunky) --resolve, which is still necessary in some situations, for having native JSON pretty printing most of the time
I also like that it's Python and I can probably change something in its source more easily and quickly than I can with cURL.
A lot of services are using OAuth (or OAuth2) and I haven't been able to figure out how to use curl with such services. Can anyone point me at a good tutorial for using curl with Flickr in particular?
I would probably not reach for curl as my first tool to interact with OAuth v2 datasources. Flickr seems to have a wide variety of available libraries[0], and they also have API documentation. Is there a good reason to use curl rather than something else?
34 comments
[ 0.23 ms ] story [ 85.0 ms ] thread[0] https://curl.haxx.se/docs/manpage.html
You have a true once in a life time opportunity with how badly Apple is screwing the hardware pooch, if your hardware division could put out a laptop to rival the retina Macbook pro with up to date hardware and an excellent command line ecosystem you could very well shift an entire generation away from OsX.
Thanks for all the hard work I'm using Linux for windows right now.
Surface?
[0] https://chocolatey.org/
[1] https://code.visualstudio.com/
[2] https://code.visualstudio.com/docs/azure/extensions
[3] https://docs.microsoft.com/en-us/windows/wsl/about
People who work extensively in Windows environments tell me that Powershell is very, well, powerful, and I'm sure it is for certain select use cases of interacting with Windows' internals. But it's baffling, however, how completely incapable it is of handling basic things like sane, well-explained escaping behavior.
I've attempted to find explanations for how people using Powershell should properly escape JSON (either for sending to HTTP APIs or for setting JSON environment variables when using Docker for Windows) and have concluded that it's basically impossible, as the escaping behavior is so different from *nix shells and appears to be documented nowhere.
Supporting it is further complicated by lack of readily available test environments: even if I wasn't running Linux myself, spinning up a VM is free because there's no software license. This isn't the case with OS X, but I can at least assume that OS X bash works the same as Linux bash for 99% of things. Powershell is completely alien and I know of no free way to try it--maybe Azure provides some variant on their free tier, but I haven't looked into it much (my overall experience trying out Azure was that it was a dumpster fire to be avoided at all costs unless you need cloud AD, in which case it's probably amazing).
You can escape things with `. So "{`"foo`": `"an \`"escaped \`" value`"}". Or because powershell has types and objects you can just use native objects and hashes, then pipe it to `ConvertTo-Json` when you need a string.[0]
> Powershell is completely alien and I know of no free way to try it
Powershell is opensource and cross-platform as of last year. [1] Though its still definitely windows first.
0: http://wahlnetwork.com/2016/02/18/using-powershell-arrays-an...
1: https://github.com/PowerShell/PowerShell
I also like that it's Python and I can probably change something in its source more easily and quickly than I can with cURL.
Download and decompress in one go
[0] https://www.flickr.com/services/api/