title: How to access python variables in Sagemaker Jupyter Notebook shell command
body: <p>In one of the cells of Sagemaker notebook, I've set a variable</p>
  <pre><code>region=&quot;us-west-2&quot;
  </code></pre>
  <p>In subsequent cell, I run following 2 shell commands</p>
  <pre><code>!echo $region
  </code></pre>
  <p>Output</p>
  <pre><code>us-west-2
  </code></pre>
  <p>However, unable to run aws shell command using this variable</p>
  <pre><code>!aws ecr get-login-password --region $region
  </code></pre>
  <p><code>$ variable-name</code> doesn't help inside jupyter cell <code>! shell command</code></p>