Reputation: 6521
I have the following statement in windows batch.
set machinename=%1
@FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO @%i
How to replace default by my variable "machinename" ?
Upvotes: 0
Views: 59
Reputation:
How about this:
FOR /f "tokens=*" %%i IN ('docker-machine env --shell cmd "%~1"') DO %%~i
There is no need to have the machineName
variable, as machineName
points to %1
. The ~
denotes to remove surrounding quotes, and add back extra quotes, just as a precaution.
Also, %i
should be changed to %%i
. %i
is for command-line, and %%i
is for a batch file.
Upvotes: 1