#!/bin/sh
#
# This script will swap two files
#

if [ $# -ne 2 ]
then
    echo "Usage: swap file1 file2"
    exit 1
fi

if [ ! -f $1 -o ! -f $2 ]
then 
    echo "Usage: swap file1 file2"
    exit 2
fi

/bin/mv $1 /tmp/swap.$$      # move the file to a "temp" file
/bin/mv $2 $1
/bin/mv /tmp/swap.$$ $2      # I create a unique temp file
                                # by using the PID ($$) 
                                #   as part of the name

