#! /bin/csh -f # # Filename: copy # # The syntax is: copy file (to copy to current directory) # or # copy file destination # if ($#argv == 0 || $#argv > 2) then echo "ERROR -- correct syntax:" echo "copy file" echo " or" echo "copy file destination" exit(1) # a nonzero exit status indicates an error else if ($#argv == 1) then cp $argv[1] . else # $#argv must be 2 cp $argv[1] $argv[2] endif exit(0)