diff options
author | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2024-02-20 18:53:58 +0000 |
---|---|---|
committer | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2024-02-20 18:55:51 +0000 |
commit | 94577271ee81d3399bec0328cc6a27688029edec (patch) | |
tree | 1b01132e15db02538dcf10922559df5a286d1cd6 /docs/cmdline-opts/output.md | |
parent | 97598f1763810e446ff21ec60fb0b222097b32c6 (diff) | |
parent | 5ce164e0e9290c96eb7d502173426c0a135ec008 (diff) | |
download | curl-94577271ee81d3399bec0328cc6a27688029edec.tar.gz |
Upgrade curl to curl-8_6_0
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update external/curl
For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md
Test: TreeHugger
Change-Id: I083147dff18fe11adc3131953c5ad4a3e14433fe
Diffstat (limited to 'docs/cmdline-opts/output.md')
-rw-r--r-- | docs/cmdline-opts/output.md | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/docs/cmdline-opts/output.md b/docs/cmdline-opts/output.md new file mode 100644 index 000000000..876c90c81 --- /dev/null +++ b/docs/cmdline-opts/output.md @@ -0,0 +1,57 @@ +--- +c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. +SPDX-License-Identifier: curl +Long: output +Arg: <file> +Short: o +Help: Write to file instead of stdout +Category: important curl +Added: 4.0 +Multi: append +See-also: + - remote-name + - remote-name-all + - remote-header-name +Example: + - -o file $URL + - "http://{one,two}.example.com" -o "file_#1.txt" + - "http://{site,host}.host[1-5].example" -o "#1_#2" + - -o file $URL -o file2 https://example.net +--- + +# `--output` + +Write output to <file> instead of stdout. If you are using {} or [] to fetch +multiple documents, you should quote the URL and you can use '#' followed by a +number in the <file> specifier. That variable is replaced with the current +string for the URL being fetched. Like in: + + curl "http://{one,two}.example.com" -o "file_#1.txt" + +or use several variables like: + + curl "http://{site,host}.host[1-5].example" -o "#1_#2" + +You may use this option as many times as the number of URLs you have. For +example, if you specify two URLs on the same command line, you can use it like +this: + + curl -o aa example.com -o bb example.net + +and the order of the -o options and the URLs does not matter, just that the +first -o is for the first URL and so on, so the above command line can also be +written as + + curl example.com example.net -o aa -o bb + +See also the --create-dirs option to create the local directories +dynamically. Specifying the output as '-' (a single dash) passes the output to +stdout. + +To suppress response bodies, you can redirect output to /dev/null: + + curl example.com -o /dev/null + +Or for Windows: + + curl example.com -o nul |