#!/bin/sh file="$1" bzip2 -dk "$file" out="`echo "$file" | sed -r 's/\.(bz2)|(bz)|(tbz2)|(tbz)|(bzip2)$//'`" if [ "$out" == "$file" ]; then out="$out.out"; fi echo "$out"