Created
July 6, 2018 23:59
-
-
Save AutomateAaron/a5456328c2736e631a10a26431aa4480 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
from="$(pwd)" | |
to="/media/aaron/Data" | |
declare -a arr=("documents" "downloads" "music" "pictures" "projects" "public" "templates" "videos") | |
declare -A map | |
map["desktop"]="desktop-ubuntu" | |
for i in "${arr[@]}" | |
do | |
map[$i]=$i | |
done | |
for key in ${!map[@]} | |
do | |
mkdir -p $to/${map[$key]}/ | |
mv $from/$key/* $to/${map[$key]}/ | |
rmdir $from/$key/ | |
ln -s $to/${map[$key]} $from/$key | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment