Created
July 11, 2011 04:21
-
-
Save agargiulo/1075309 to your computer and use it in GitHub Desktop.
simple zsh script to move rc files around in home directory/repo
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/zsh | |
# go to $HOME | |
cd ~ | |
# look for all .*rc files | |
for rc in \.*rc; | |
do; | |
# $rc2 = filename without the leading . | |
rc2=${rc:e} | |
if [[ -f "~/rc/$rc2" ]] | |
then | |
print "$rc is already in the repo" | |
else | |
mv -v $rc rc/$rc2 && print "$rc was added to the repo"; | |
print "now linking back to home"; | |
ln -vs rc/$rc2 ~/$rc | |
fi; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment