title: Extract zip files contents and rename the directory dynamically
body: <p>I have an application zip file created using Play Framework. It create the zip file with name A-1.0.zip. This zip file contains the directory with name A-1.0. (1.0 changes according to the version)</p>
  
  <p>I wanted to extract the zip file and rename the folder from A-1.0 to A. So that my application init.d script finds the directory to start the application. This shuld be done dynamically using shell script.</p>
  
  <p>Is there a way where i can extract all the zip files into A folder instead of extracting into A-1.0 and renaming?? Please help!</p>
  
  <p>The following is what I tried....</p>
  
  <pre><code>unzip A-1.0.zip -d ~/A
  </code></pre>
  
  <p>(I know that it is very dumb of me to do this !!)</p>
  
  <p>This extracted the file into <code>~/A/A-1.0/[contents]</code></p>
  
  <p>I need to extract all the [contents] into <code>~/A</code> instead of <code>~/A/A-1.0/</code>. I dunno how to do this using command line.....</p>
  
  <p>My init.d script searched for <code>~/A/bin/A -Dhttp.port=6565 -Dconfig.file=~/A/conf/application.conf</code> to start the Play! application.</p>
  
  <p>To make this script working, I extract all into A-1.0/ then I rename with <code>mv ~/A-1.0 ~/A</code> manually.</p>