#!/bin/sh # # gv_uncompress # # Uncompresses $1 with bzip2 -d to $2 if $1 ends in .bz2, otherwise # uncompresses with gzip -d. # To be used as uncompress-command with gv (the successor of Tim Theisen's # ghostview), as # gv_uncompress %s %s # instead of the default # gzip -d -c %s > %s # # Copyright (C) by Volker Kuhlmann # Released under the terms of the GNU General Public License (GPL) Version 2. # See http://www.gnu.org/ for details. # # Volker Kuhlmann # 22 Aug 2003 # file="$1" tmpfile="$2" if file "$file" | grep 'bzip2 compressed' >/dev/null; then bzip2 -d -c "$file" > "$tmpfile" else gzip -d -c "$file" > "$tmpfile" fi