title: Tcl print cwd and use it as string
body: <p>I was making a small script in tcl for VMD:</p>
  <pre><code>mol load psf run_1/structure.psf xtc run_1/postDocking_wrapped.xtc
  set final [atomselect top &quot;not (water or ions or resid 1216)&quot; frame last]
  
  $final writepdb last_frame.pdb
  puts &quot;finished!&quot;
  
  quit
  </code></pre>
  <p>I wish i could add the folder I'm working in as a string to last_frame.pdb</p>
  <p>like: last_frame_A1234.pdb where A1234 is my current folder.
  When I try:</p>
  <pre><code>set path [file dirname [file normalize [info script] ] ]
  </code></pre>
  <p>it just returns a &quot;.&quot;</p>
  <p>I have also tried:</p>
  <pre><code>set path [file [info script]]
  </code></pre>
  <p>but the result is always the &quot;.&quot; rather than A1234F.</p>
  <p>If I put:</p>
  <pre><code>set path [pwd]
  </code></pre>
  <p>it would give me the full path (with the &quot;/&quot;) and writepdb does not accept special characters.</p>
  <p>Is there any way to just get the cwd? or from pwd access only to the last folder and use it as a string?</p>
  <p>Thank you!</p>