xref: /aosp_15_r20/external/curl/docs/cmdline-opts/_GLOBBING.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker<!-- Copyright (C) Daniel Stenberg, <[email protected]>, et al. -->
2*6236dae4SAndroid Build Coastguard Worker<!-- SPDX-License-Identifier: curl -->
3*6236dae4SAndroid Build Coastguard Worker# GLOBBING
4*6236dae4SAndroid Build Coastguard WorkerYou can specify multiple URLs or parts of URLs by writing lists within braces
5*6236dae4SAndroid Build Coastguard Workeror ranges within brackets. We call this "globbing".
6*6236dae4SAndroid Build Coastguard Worker
7*6236dae4SAndroid Build Coastguard WorkerProvide a list with three different names like this:
8*6236dae4SAndroid Build Coastguard Worker
9*6236dae4SAndroid Build Coastguard Worker    "http://site.{one,two,three}.com"
10*6236dae4SAndroid Build Coastguard Worker
11*6236dae4SAndroid Build Coastguard WorkerDo sequences of alphanumeric series by using [] as in:
12*6236dae4SAndroid Build Coastguard Worker
13*6236dae4SAndroid Build Coastguard Worker    "ftp://ftp.example.com/file[1-100].txt"
14*6236dae4SAndroid Build Coastguard Worker
15*6236dae4SAndroid Build Coastguard WorkerWith leading zeroes:
16*6236dae4SAndroid Build Coastguard Worker
17*6236dae4SAndroid Build Coastguard Worker    "ftp://ftp.example.com/file[001-100].txt"
18*6236dae4SAndroid Build Coastguard Worker
19*6236dae4SAndroid Build Coastguard WorkerWith letters through the alphabet:
20*6236dae4SAndroid Build Coastguard Worker
21*6236dae4SAndroid Build Coastguard Worker    "ftp://ftp.example.com/file[a-z].txt"
22*6236dae4SAndroid Build Coastguard Worker
23*6236dae4SAndroid Build Coastguard WorkerNested sequences are not supported, but you can use several ones next to each
24*6236dae4SAndroid Build Coastguard Workerother:
25*6236dae4SAndroid Build Coastguard Worker
26*6236dae4SAndroid Build Coastguard Worker    "http://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html"
27*6236dae4SAndroid Build Coastguard Worker
28*6236dae4SAndroid Build Coastguard WorkerYou can specify a step counter for the ranges to get every Nth number or
29*6236dae4SAndroid Build Coastguard Workerletter:
30*6236dae4SAndroid Build Coastguard Worker
31*6236dae4SAndroid Build Coastguard Worker    "http://example.com/file[1-100:10].txt"
32*6236dae4SAndroid Build Coastguard Worker
33*6236dae4SAndroid Build Coastguard Worker    "http://example.com/file[a-z:2].txt"
34*6236dae4SAndroid Build Coastguard Worker
35*6236dae4SAndroid Build Coastguard WorkerWhen using [] or {} sequences when invoked from a command line prompt, you
36*6236dae4SAndroid Build Coastguard Workerprobably have to put the full URL within double quotes to avoid the shell from
37*6236dae4SAndroid Build Coastguard Workerinterfering with it. This also goes for other characters treated special, like
38*6236dae4SAndroid Build Coastguard Workerfor example '&', '?' and '*'.
39*6236dae4SAndroid Build Coastguard Worker
40*6236dae4SAndroid Build Coastguard WorkerSwitch off globbing with --globoff.
41