#!/bin/sh # # # Author: Bernhard Kuehl # Universitaet Osnabrueck # Mon Jun 16 17:42:46 MET DST 1997 # File: makeArchive # Description: # Packt als Kommandozeilen-Argumente angegebene # Dateien in ein Archiv, welches auf der Standard- # ausgabe ausgegeben wird. # PATH=/usr/local/gnu/bin:/usr/bin:/bin export PATH usage () { echo usage: `basename $0` file [file ...] >&2 exit 1 } fatal() # message { echo >&2 "$@" exit 1 } [ $# = 0 ] && usage for i in "$@" do echo processing $i >&2 [ -z "$i" ] && continue echo $i | grep -q "/" [ $? = 0 ] && fatal "no / allowed!" [ -h "$i" ] && fatal "no symbolic links allowed" [ -r "$i" ] || fatal "can't read file" [ -f "$i" ] || fatal "no regulaer file" ls -l "$i" wc "$i" cat "$i" done exit 0