Write a shell script that copies files in a directory and its subdirectory to another directory. Code: clear echo ----------------------------------- echo '\tCopy a Directories' echo ----------------------------------- echo You are working in directory pwd echo The files in directory are ls echo Enter the file name to copy read fname echo Enter directory path read path if cp $fname $path then echo Files Copied. else echo Files Not Copied fi Output: ----------------------------------- Copy a Directories ----------------------------------- You are working in directory /home/elcot The files in directory are Downloads Videos Public age Music Desktop test.sash Enter the file name to copy age Enter directory path /home/elcot/Music/ Files Copied. Hints: Before Copy a file After Copy a file
Leave a Comment