#!/usr/bin/bash
#if [ $# -lt 2 ] || [ $# -gt 2 ]
#if test $# -lt 2 -o $# -gt 2
#if [[ $# -lt 2 ]] || [[ $# -gt 2 ]]
if (($# < 2)) || (( $# > 2 ))
then
echo invalid
exit
else
echo file to be copied : $1
echo new file name : $2
cp $1 $2
echo copy successful
fi
No comments:
Post a Comment