How do I move filename
to bar.filename
without mentioning filename
twice?
In Bash I can just do: mv {,bar.}filename
. I suppose I could do:
set filename="foobar" && mv "%filename%" "bar.%filename%"
But that seems overly verbose. Could write a function also, but that seems overkill:
@echo off & setlocal ENABLEEXTENSIONS
set str="%1"
call :move %str%
:move
mv/%1/bar.%1
Batch
expert, but something looks amiss with yourset filename=...
line: shouldn't that beset foobar=...
?