title: shell string bad substitution
body: <p>I'm new to shell programming. I intend to get directory name after zip file was extracted. The print statement of it is</p>
  
  <pre><code>$test.sh helloworld.zip
  helloworld
  </code></pre>
  
  <p>Let's take a look at test.sh:</p>
  
  <pre><code>#! /bin/sh
  length=echo `expr index "$1" .zip`
  a=$1    
  echo $(a:0:length}
  </code></pre>
  
  <p>However I got the Bad substitution error from the compiler.</p>
  
  <p>And when I mention about 'shell'.I just talking about shell for I don't know the difference between bash or the others.I just using Ubuntu 10.04 and using the terminal. (I am using bash.)</p>