3 ms·
I wonder what the use case for this is, when every shell already offers parameter expansion of some kind. Is it so that you can write Curl command lines that wo
by nerdponx 3y ago
I wonder what the use case for this is, when every shell already offers parameter expansion of some kind. Is it so that you can write Curl command lines that work in any shell identically, once properly quoted?
- twic 3y agoYou can tell curl to read its arguments from a file, in which case a shell won't get to interpret them first, perhaps this feature is aimed at that?
- Nmi2osv7 3y ago[dead]
- Timon3 3y agoThe blog post states the feature got implemented because a user wanted to use environment variables for values in configuration file variables.
- nerdponx 3y agoI missed that, thanks.
- eesmith 3y agoLooks like there are a couple of use cases. The expansion supports several transformations that can help build values: "json" outputs the content using JSON string quoting rules. "url" shows the content URL (percent) encoded. "b64" expands the variable base64 encoded Command-line arguments are visible to others (eg, through ps or /proc/<pid>/cmdline) so including a secret directly on the command-line may leak data. (For context, here's a SO message asking how to avoid that sort of leakage: https://stackoverflow.com/questions/3830823/hiding-secret-from-command-line-parameter-on-unix https://stackoverflow.com/questions/3830823/hiding-secret-fr... ) You can use different files for different configurations, rather than depend on (global) shell variables.