From 0af5ce162fb2838f766cc0d10d3971c0ac43aa43 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 15 Dec 2024 23:07:57 +0100 Subject: [PATCH] variable.md: mention --expand-variable for variables to variables To assign a variable using contents from another variable. Closes #15752 --- docs/cmdline-opts/variable.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/cmdline-opts/variable.md b/docs/cmdline-opts/variable.md index d9a008ea87..9ecc3f0e71 100644 --- a/docs/cmdline-opts/variable.md +++ b/docs/cmdline-opts/variable.md @@ -36,6 +36,12 @@ the environment variable is not set, use --variable %name=content or --variable %name@content. Note that on some systems - but not all - environment variables are case insensitive. +To assign a variable using contents from another variable, use +--expand-variable. Like for example assigning a new variable using contents +from two other: + + curl --expand-variable "user={{firstname}} {{lastname}}" + When expanding variables, curl supports a set of functions that can make the variable contents more convenient to use. You apply a function to a variable expansion by adding a colon and then list the desired functions in a