#!/bin/sh

# Reverse.bash
# Chieh Cheng
# 2007-02-02

# GNU General Public License (GPL), Version 2, June 1991

  scriptName=`echo "$0" | sed s/.*\\\\///g`

processFile ()
{
  infile="$1"
  outfile="$2"

  if [ -f "${outfile}" ]
  then
    echo "${outfile} already exists."
  else
    tac "${infile}" > "${outfile}"
  fi
}

  if [ $# -lt 2 ]
  then
    echo "  Usage:   ${scriptName} \"infile\" \"outfile\""
  else
    processFile "$@"
  fi
