#!/bin/sh if [ "`echo "$1" | grep .zip`" ]; then comando="unzip" else if [ "`echo "$1" | grep .rar`" ]; then comando="unrar x -p-" else if [ "`echo "$1" | grep .ace`" ]; then comando="unace x -c-" else if [ "`echo "$1" | grep .tar.bz2`" ]; then comando="tar -xvjf" else if [ "`echo "$1" | grep .tar.gz`" ]; then comando="tar -xvjf" else comando="tar -xvf" fi fi fi fi fi dir=`dirname "$1"` filename=`basename "$1"` cd "$dir" $comando "$filename" cd "$OLDPWD"