Created
September 3, 2016 16:51
-
-
Save wikitopian/28cf92f407b6a839acfc04ff95a371ed 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
#!/bin/bash | |
find $1 -type f | sed -e "s#$1\(.*\)#rm -f \\1#g" | bash | |
find $1 -type f | sed -e "s#$1\(.*\)\/\(.*\)#mkdir -p \\1#g" | bash | |
find $1 -type f | sed -e "s#$1\(.*\)#ln -s $PWD\/fs\1 \1#g" | bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Rapidly configure a system by crafting a shadow root directory of all the configuration files, then automatically crawl through it and replace the original configuration files with symbolic links.
Usage
The argument is the path of the shadow root. In this case, it's
fs/
.sudo ./sym-copy.sh fs