#! /bin/bash # # Filename: out # # From Mark Sobell's Red Hat Linux book. Adapted by Br. David Carlson. # # Date: March 25, 2007 # # This script, when given filenames as command-line arguments, displays with cat # those files on the screen. When the first argument is -v, it displays with # the more utility the files whose names are the other arguments. if [ $# -eq 0 ] then echo "Syntax: out [-v] " 1>&2 exit 1 elif [ "$1" = "-v" ] then shift # drop the -v argument more -- "$@" else cat -- "$@" fi