#!/bin/sh # # 7z-r - 7zip the indicated files (or directories) into 7zfiles # # $Id$ Die() { echo fatal error: $@ 1>&2; exit 1; } IsCommand() { command -v "$1" >/dev/null; } if IsCommand 7zr then zipper=7zr elif IsCommand 7z then zipper=7z else Die cannot find executable 7z or 7zr fi for f in "$@" do case "$f" in *.7z) ;; *) $zipper a "$f".7z "$f" ;; esac done