News for hackers. Stuff that matters.
Re:Studio Ghibli releases 400 free-to-use images by pxndxx on Wednesday September 23, 2020 @08:14AM (#24566058)
That's a shell feature, not wget's.
Re:Studio Ghibli releases 400 free-to-use images by jasonjayr on Wednesday September 23, 2020 @02:21PM (#24570182)
Curl has it built in:

    curl -O 'https://example.org/[2-4].jpg'
(quotes disable any kind of shell expansion)
Re:Studio Ghibli releases 400 free-to-use images by lohfu on Wednesday September 23, 2020 @08:19AM (#24566099)
Really? I thought the shell could only expand globs if it matches files on the local file system?
Re:Studio Ghibli releases 400 free-to-use images by lloeki on Wednesday September 23, 2020 @08:32AM (#24566212)
The feature is called brace expansion:

https://www.gnu.org/software/bash/manual/html_node/Brace-Exp...

You may also be interested in yet another powerful feature that is parameter expansion:

https://www.gnu.org/software/bash/manual/html_node/Shell-Par...

Filename expansion (nitpick: often mistaken for globbing) is performed last:

https://www.gnu.org/software/bash/manual/html_node/Filename-...

Re:Studio Ghibli releases 400 free-to-use images by account42 on Thursday September 24, 2020 @03:25AM (#24576189)
> nitpick: often mistaken for globbing

What exactly would you call globbing if not the feature that is controlled using the nullglob, failglob, nocaseglob and dotglob options as well as the GLOBIGNORE variable.

Re:Studio Ghibli releases 400 free-to-use images by lloeki on Thursday September 24, 2020 @04:03AM (#24576408)
Globbing has an ambivalent definition given that it’s mostly used for filename matches (especially given its origin as the glob command), but it’s really a specific form of pattern matching using wildcards such as * and ?, it need not apply only to filenames or paths on the filesystem: this matching is also used to match strings in case/in/esac constructs and test’s == !=

https://www.gnu.org/software/bash/manual/bash.html#Condition...

I guess one could say globbing is applying this pattern matching to filter a list.

Re:Studio Ghibli releases 400 free-to-use images by falcor84 on Wednesday September 23, 2020 @08:23AM (#24566134)
You're right regarding glob functionality, but the curly braces are a separate shell feature. The most useful idiom I use it for is renaming or copying, e.g.:

cp filename{,_backup}

Re:Studio Ghibli releases 400 free-to-use images by ses1984 on Wednesday September 23, 2020 @08:20AM (#24566114)
Thoae aren't globs, if you put an asterisk there it would not work.