#!/bin/sh -e for dir in etc do mkdir -p "$1/$dir" cp -r system/$dir/* "$1/$dir" done for configdots in $(ls user/configdir/) do mkdir -p "$1/home/$USER/.config/" mv user/configdir/$configdots "$1/home/$USER/.config/" done for homedots in $(ls user/homedir/*) do mkdir -p "$1/home/$USER/" mv $homedots "$1/home/$USER/.$(basename $homedots)" done