#! /bin/ksh # # Author: Mike Fleming mike@tauzero.co.uk # # Run file viewer # # If this is being run at the end of a pipeline, copy stdin to a # temporary file and redirect the input back to the terminal, then # use the temporary file as input if [[ -t 0 ]] then cobrun fileview "$*" else if [[ "$TMP" == "" ]] then TMPFILE=$HOME/stdin$$ else TMPFILE=$TMP/stdin$$ fi cat > $TMPFILE exec 0