Skip to content

Instantly share code, notes, and snippets.

@gyermolenko
Last active April 2, 2018 12:51
Show Gist options
  • Save gyermolenko/67975a3268890eb810b749aa11c78235 to your computer and use it in GitHub Desktop.
Save gyermolenko/67975a3268890eb810b749aa11c78235 to your computer and use it in GitHub Desktop.
bash script to copy folders if they are not present in destination
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