#!/bin/sh set -e # set -x # Simple shell script to package and send over my dotfiles to a remote machine package="$(mktemp -d)" for _f in bashrc mkshrc tmux.conf tmux_helper.sh ; do cp "$_f" "$package/.$_f" done touch "$package/.tmux.conf.local" echo "Sending: " ls -AF "$package" | sed -e's/^/ /' for host in "$@" ; do echo "Operating on host: $host" tar -C "$package" -czf - . | ssh "$host" "tar -xzf -" done rm -rf "$package"