Last active
April 2, 2018 12:51
-
-
Save gyermolenko/67975a3268890eb810b749aa11c78235 to your computer and use it in GitHub Desktop.
bash script to copy folders if they are not present in destination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM="from" | |
TO="to" | |
for i in $( ls $FROM); do | |
if [ -d "$TO/$i" ]; then | |
echo "$TO/$i exists" | |
else | |
cp -r $FROM/$i $TO/$i | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment