Skip to content

Instantly share code, notes, and snippets.

@agargiulo
Created July 11, 2011 04:21
Show Gist options
  • Save agargiulo/1075309 to your computer and use it in GitHub Desktop.
Save agargiulo/1075309 to your computer and use it in GitHub Desktop.
simple zsh script to move rc files around in home directory/repo
#!/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