Posts

Showing posts with the label Solved UNIX ASSIGNMENT-4

Solved UNIX ASSIGNMENT-4 New

Image
UNIX ASSIGNMENT-4 Solved Tutorial - 4 Subject : Unix & Shell Programming 1.      write a shell script to copy one file into other, display appropriate message if destination file already exist. Script: echo "Enter source filename: " read sname echo "Enter destination filename: " read dname if [ -f $sname ] then         if [ -f $dname ]         then                 echo "Destination file already exists"                 echo "Do You want to overwrite the file?(y/n)"                 read ans                 if [ $ans = 'Y' -o $ans = 'y' ]                 then                         cp $sname $dname                         echo "Destination file overwritten"                 else                         echo "File not copied to Destination"                 fi         elif [ -d $dname ]         then                 echo "Destination type is directory"                 echo "Do you want to copy file