Created
August 1, 2017 08:18
-
-
Save jeepkd/bf3865dfe66f1b3c520b603812a6d4d1 to your computer and use it in GitHub Desktop.
This file contains 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
src='nanameue' | |
tar='test' | |
for p in $(find $src -type d | sort | awk '$0 !~ last "/" {print last} {last=$0} END {print last}') | |
do | |
mkdir -p $(echo $p | sed "s/$src/$tar/") | |
path=$(realpath $p) | |
for f in $(find $path -type f) | |
do | |
newf=$(echo $f | sed "s/$src/$tar/" | xargs realpath) | |
ln -s $f $newf | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment