#!/bin/sh # poor replacements for standard unix tools when all that's available is # ash or bash shell # most won't work with binary files at all, and destroy formatting of text die () { echo "$@" >&2 exit 1 } cat () { if [ "$1" ]; then for file in $@; do exec 3<$file while read -u 3 whatever; do echo $whatever done exec 3<&- done else while read whatever; do echo $whatever done fi } grep () { if [ -z "$1" ]; then die "Usage: grep PATTERN [[FILE] ...]"