#!/bin/sh myname="$0" fetchcmd=curl hostarg="" eval cast=\${$#} if tail -r /dev/null > /dev/null 2>&1; then filter="tail -r" elif tac /dev/null > /dev/null 2>&1; then filter=tac else >&2 echo "Don't know how to reverse feed! Defaulting to feed order" fi args=$(getopt fih $*) if [ $? -ne 0 ]; then echo "Usage: $myname [-fih] linktorss" >& 2 exit 1 fi set -- $args while [ "$1" != -- ]; do case "$1" in -f) fetchcmd=cat ;; -i) filter=cat ;; -h) hostarg="--host=$3" ;; esac shift done shift if [ $# -lt 3 ]; then $fetchcmd $cast|grep "&2 exit 1 fi