News for hackers. Stuff that matters.
Re:Renaming files with mv without typing the name two times by matheusmoreira on Monday April 13, 2020 @08:10PM (#22861563)
This is such an awesome bash feature. Makes it so easy to generate variations of names. What is it called?
Re:Renaming files with mv without typing the name two times by LeifCarrotson on Monday April 13, 2020 @08:26PM (#22861664)
One of my pet peeves about expressive, terse syntaxes like this is that the features are not Google-able. Entering {} or !#:1 or !? in the search bar is more like swearing than like learning. This one happens to be called "Brace Expansion".

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

Importantly, realize it's a feature of Bash that deals with strings, not a feature of mv that deals with filenames. It just replaces a word containing a brace expression with a set of words that contain each pattern in the list.

In general, though, I wish that terminals and text editors that do nice things like syntax highlighting and autocomplete supported help text better. Perhaps selecting some text and hovering with your mouse or hitting F1 could bring up a minimal syntax example of the feature you're looking at...

Re:Renaming files with mv without typing the name two times by Godel_unicode on Monday April 13, 2020 @09:20PM (#22861906)
Protip: for difficult to Google syntax, add "" and `site:stackoverflow.com` to your search.
Re:Renaming files with mv without typing the name two times by RMPR on Tuesday April 14, 2020 @01:40AM (#22863047)
OR site:superuser.com
Re:Renaming files with mv without typing the name two times by saagarjha on Tuesday April 14, 2020 @05:46AM (#22864152)
Google seems to ignore my punctuation either way.
Re:Renaming files with mv without typing the name two times by haecceity on Monday April 13, 2020 @08:16PM (#22861607)
Re:Renaming files with mv without typing the name two times by blaenk on Monday April 13, 2020 @11:24PM (#22862492)
Re:Renaming files with mv without typing the name two times by KrisJordan on Monday April 13, 2020 @08:17PM (#22861614)
This feature is brace expansion.