#!/bin/sh dir=`dirname $1` file=`basename "$1"` cd $dir tar -cvjf $1.tar.bz2 "$file" cd $OLDPWD