hi guys i want a script manually copy all directories and files. Dont want to use cp-r, cp-R or any variant. How to do this, the piece of code i need is commented in the script
#!bin/bash
IFS=$'\n'
if test "$1" = ""
then
wd=pwd
else
wd=$1
fi
for file in $(find $1)
do
if [ -f $file ]; then
cp $file ~/Desktop
elif [ -d $file ]; then
#copy directory,subdirectory and files wihtout
#using cp-r, cp-R or any variant
fi
done
thanks in advance
---------- Post updated at 10:17 AM ---------- Previous update was at 09:38 AM ----------
Something like, when a directory is found elif [ -d file ]; then
look in that directory if it contains more files or folders
create or copy folder and also containing files and folders