What does this mean?
if [ -f $2/$1 ]
and this line:
cp $1 $2/$1
Does $2/$1
represent a file, because it's associated with -f
?
#!/bin/bash
if test $# -ne 2
then
echo "Numbers of argument invalid"
else
if [ -f $2/$1 ]
then
echo "file already exist , replace ?"
read return
if test $return = 'y'
then
cp $1 $2/$1
else
exit
fi
else
cp $1 $2/$1
fi
fi