"Fossies" - the Fresh Open Source Software Archive

Member "mpr-2.8/mprfilter" (8 Dec 1999, 321 Bytes) of package /linux/misc/old/mpr-2.8.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 case "$#" in
    4 1)  MPRFILTER=cat;;
    5 2)  if test ! -r "$2"; then
    6         echo "$1: error: cannot read $2" >&2
    7         exit 1
    8     fi
    9     if file "$2" | grep compress >/dev/null 2>&1; then
   10         MPRFILTER="gzip -dc $2"
   11     else
   12         MPRFILTER="cat $2"
   13     fi;;
   14 *)  echo "usage: mprfilter prog [filename]" >&2
   15     exit 1;;
   16 esac
   17 
   18 echo "$MPRFILTER"
   19 exit 0