From 0cd29e031c62594aae02f4bd13cb319c91e92776 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 19 Dec 2024 16:55:25 +0100 Subject: [PATCH] variables.md: document the byte range coming in 8.12.0 Closes #520 --- cmdline/variables.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmdline/variables.md b/cmdline/variables.md index 4a3fef032..18332a368 100644 --- a/cmdline/variables.md +++ b/cmdline/variables.md @@ -35,6 +35,14 @@ You can assign the contents of a plain text file to a variable, too: curl --variable varName@filename +Starting in curl 8.12.0, you can get a byte range from a given file by +appending `;[N-M]` to the file name, where `N` and `M` are numerical byte +offsets into the file where the second number can be omitted to mean until end +of file. For example, get the contents from a file from byte offset 100 to and +including byte offset 200: + + curl --variable "varName@filename;[100-200]" + ## Expand Variables can be expanded in option parameters using `{{varName}}` when the