#!/bin/bash if [ "$1" = "" ]; then echo "usage is as follows: $0 filename.deb" exit 1 fi MAINDIR=`echo $1 | sed -e 's/.deb//g'` DEBIANDIR="$MAINDIR/DEBIAN" mkdir -p $MAINDIR/DEBIAN dpkg -x $1 $MAINDIR dpkg -e $1 $DEBIANDIR echo "$1 unpacked to $MAINDIR"