title: Bash create .tar.gz on Solaris
body: <p>I'm writting a bash script, which should create a .tar.gz archive from specified directory including file structure. This is a homework and I need it to work on Solaris system my school uses. That means I can't use tar like this</p>
  
  <pre><code>tar xvzf archive.tar.gz ./
  </code></pre>
  
  <p>because this system uses some older version of tar without -z option. I use it like this</p>
  
  <pre><code>tar xvf - ./ | gzip &gt; archive.tar.gz
  </code></pre>
  
  <p>It works fine except a strange fact, that when I examine contents of the archive, it contains itself (in other words, it contains "archive.tar.gz"). How can I prevent this?</p>