title: bash syntax error while running docker command
body: <p>I was getting an error while running the docker ps command which is - </p>
  
  <pre><code>&gt; An error occurred trying to connect: Get
  &gt; http://localhost:2375/v1.21/containers/json?all=1: dial tcp
  &gt; 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it.
  </code></pre>
  
  <p>I was trying to correct the error using the instruction present in this forum -
  <a href="https://forums.docker.com/t/windows-an-error-occurred-trying-to-connect/4384" rel="nofollow noreferrer">https://forums.docker.com/t/windows-an-error-occurred-trying-to-connect/4384</a></p>
  
  <p>I am facing an error in the last step i.e. running this command in git bash -</p>
  
  <pre><code>FOR /f "tokens=*" %i IN ('"C:\Program Files\Docker Toolbox\docker-machine.exe" env --shell cmd machinename') DO %i
  </code></pre>
  
  <p>The error which I get is </p>
  
  <pre><code>bash: syntax error near unexpected token `('
  </code></pre>
  
  <p>Any help to solve this issue? I tried to escape the single and double quotes and that didn't work.</p>