Created
July 16, 2012 19:33
-
-
Save eiwe/3124549 to your computer and use it in GitHub Desktop.
Bash script to copy a list of files with you everywhere you go
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 | |
p(){ printf "\n [ $* ]\n\n";} | |
l="$HOME/.syncfiles";[ -f $l ]||{ p "$l missing. Won't sync files.";} | |
[ $# -eq 0 ]&&{ exit 1;} | |
h="$1";shift;p=`pwd`;cd | |
tar -hcf- `cat $l`|ssh $h 'tar -xf -' | |
ssh $h "$@" | |
cd $p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment