#!/bin/sh
#If the source filename is a directory,exit
if [ -d $1 ]
then
echo The first arguments must be a file,not directory!
exit
fi
currentpath=$(pwd)
newfilename=$2
#While the destination file is a DIR
if [ -d $2 ]
then
cd $2
newbasename=$(basename $1)
newpath=$(pwd)
newfilename=${newpath}/${newbasename}
cd $currentpath
fi
cat $1>${newfilename}