Skip to content

Instantly share code, notes, and snippets.

@erfanoabdi
Created June 16, 2018 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erfanoabdi/f999196ad56388368c49d967e32d89be to your computer and use it in GitHub Desktop.
Save erfanoabdi/f999196ad56388368c49d967e32d89be to your computer and use it in GitHub Desktop.
#/bin/sh
proptxt="$1"
dirsrc="$2"
dirdis="$3"
while read -r line
do
[[ $line = \#* ]] && continue
[ -z "$line" ] && continue
if [[ $line = '-'* ]]
then
line=`echo "$line" | cut -c2-`
fi
filesrc=`echo "$line" | cut -d ":" -f 1 | cut -d "|" -f 1`
filedis=`echo "$line" | cut -d ":" -f 2 | cut -d "|" -f 1`
filedir=`echo $filedis | rev | cut -d "/" -f 2- | rev`
sudo mkdir -p "$dirdis/$filedir"
sudo cp -fpr "$dirsrc/$filesrc" "$dirdis/$filedir/"
done < "$proptxt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment