Re:Renaming files with mv without typing the name two times
by CraneWorm on Tuesday April 14, 2020 @05:11PM
(#22871503)
Sorry, I should have checked.
I jumped at it because there are other things one might like to achieve with brace expansion but turn out to be impossible because it is evaluated first - you can't use them with variables.
The eval is there because in bash text expansion occurs after ';' is interpreted, and we need that to be the other way around. Hence, the escaping of ';' in the input to preserve it for text expansion, and then the eval afterward to get ';' interpreted.