#!/bin/ksh #A file copy program if [[ $# -ne 2 ]] then echo Incorrect number of arguments supplied - The script will now ask you to enter the filenames echo "Please give me an input file: \c" read ifile echo "Please give me an output file: \c" read ofile else ifile=$1 ofile=$2 fi if [[ -f $ofile ]] then echo Sorry - output file exists exit fi if [[ ! -r $ifile ]] then Sorry - cannot read input file exit fi cp $ifile $ofile