1
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
I'm not a
Batch
expert, but something looks amiss with yourset filename=...
line: shouldn't that beset foobar=...
? – BenjiWiebe – 2014-12-27T05:10:52.660I don't know such way in DOS or PowerShell and I doubt it exists. I suggest to install Git, as it includes Bash, which is just wonderful – janos – 2014-12-27T10:21:09.813