After creating a container on AWS using docker-machine, my book says you can use the syntax eval $(docker-machine env ) to write the environment variables into the shell. However, the command doesn’t work and I get an error message about faulty syntax (syntax error near unexpected token `(’).
I thought there must be a mistake in the book but I’ve since seen the same command used in examples on other web sites. So I thought either my environment isn’t set up correctly or there’s something I’m not understanding.
I’m using the Linux environment for Windows 10 and using the wsl comand to get into the bash shel
I see if I run the command without the eval, it includes some REM commands that include brackets, so I wonder if the problem is that the command is outputting junk that the shell doesn’t understand.
Actually, if I try to run the REMed code:
@FOR /f “tokens=*” %i IN (’“C:\ProgramData\chocolatey\lib\docker-machine\bin\docker-machine.exe” env aws-node-1’) DO @%i
it fails with the same error message.