Write a script to copy the file system from two directories to a new directory in such a way that only the latest file is copied in case there are common files in both the directories.

echo -e “Enter the file name you want to copy::\c”

read filename

if [ -f $filename ]

then

echo -e “Enter the destination the where you want to copy::\c”

read  sdire

if [ -d $sdire ]

then

cp -u $filename $sdire

echo “File is copy”

else

echo “Directory name is not exits”

fi

else

echo “File name is not present”

fi

 

OUTPUT::

 

Enter the file name you want to copy::a24.sh

Enter the destination the where you want to copy::a

File is copy

 

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.