Re: Reference upload glob pieces in output filename
Bastian Jesuiter via curl-users <[email protected]> Wed, 22 Apr 2026 10:07:55 +0200
| Newsgroups | gmane.comp.web.curl.general |
|---|---|
| Message-ID | <CAL07qPXfUvuw97CM3pOWxg64hdhn0haTn278D2yC8R6oyM6X5g@mail.gmail.com> |
--===============7655265886618140747==
Content-Type: multipart/alternative; boundary="000000000000474544065008084a"
--000000000000474544065008084a
Content-Type: text/plain; charset="UTF-8"
Maybe something like
curl -T 'file{<glob1>1,2,3}' https://upload.example/{<glob2>this,that} -o
'response-#<glob1>-#<glob2>'
Although < > are bash special cars, inside of strings they could be used I
guess.
As regex usually uses (?<namedGroup>) for it's syntax it would be familiar.
Alternatively omitting the <> in the second part where the replacement
happens would also be good for readability, but would make it probably
impossible to know when the named group ends and the string continues.
On Wed, 22 Apr 2026, 10:00 Daniel Stenberg, <[email protected]> wrote:
> On Wed, 22 Apr 2026, Bastian Jesuiter wrote:
>
> > Would something more explicit, like something close or similar to regex
> > named groups possible to circumvent such a confusion?
>
> How do you envision a command line to look like if that would be used?
>
> --
>
> / daniel.haxx.se || https://rock-solid.curl.dev
>
--000000000000474544065008084a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto">Maybe something like=C2=A0<div dir=3D"auto"><br></div><di=
v dir=3D"auto">curl -T 'file{<glob1>1,2,3}' <a href=3D"https:=
//upload.example/{">https://upload.example/{</a><glob2>this,that} -o =
'response-#<glob1>-#<glob2>'</div><div dir=3D"auto"><br=
></div><div dir=3D"auto">Although < > are bash special cars, inside o=
f strings they could be used I guess.=C2=A0</div><div dir=3D"auto"><br></di=
v><div dir=3D"auto">As regex usually uses (?<namedGroup>) for it'=
s syntax it would be familiar.=C2=A0</div><div dir=3D"auto">Alternatively o=
mitting the <> in the second part where the replacement happens would=
also be good for readability, but would make it probably impossible to kno=
w when the named group ends and the string continues.=C2=A0</div><div dir=
=3D"auto"><br></div><div dir=3D"auto"><br></div></div><br><div class=3D"gma=
il_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On We=
d, 22 Apr 2026, 10:00 Daniel Stenberg, <<a href=3D"mailto:[email protected]=
">[email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On =
Wed, 22 Apr 2026, Bastian Jesuiter wrote:<br>
<br>
> Would something more explicit, like something close or similar to rege=
x <br>
> named groups possible to circumvent such a confusion?<br>
<br>
How do you envision a command line to look like if that would be used?<br>
<br>
-- <br>
<br>
=C2=A0 / <a href=3D"http://daniel.haxx.se" rel=3D"noreferrer noreferrer" ta=
rget=3D"_blank">daniel.haxx.se</a> || <a href=3D"https://rock-solid.curl.de=
v" rel=3D"noreferrer noreferrer" target=3D"_blank">https://rock-solid.curl.=
dev</a><br>
</blockquote></div>
--000000000000474544065008084a--
--===============7655265886618140747==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette: https://curl.se/mail/etiquette.html
--===============7655265886618140747==--