blob: 063f445e7c056ea79faf3a07401446ea9a5f33d8 [file] [log] [blame]
bigbiff60873392020-03-23 15:41:27 -04001#!/bin/bash
Dees_Troy51a0e822012-09-05 15:24:24 -04002
3process_file()
4{
5 dst=$1/$(basename $2)
6 src=$2
bigbiff60873392020-03-23 15:41:27 -04007
bigbiffad58e1b2020-07-06 20:24:34 -04008 [[ -e $src ]] || return 0
bigbiff60873392020-03-23 15:41:27 -04009
Dees_Troy51a0e822012-09-05 15:24:24 -040010 if [ $dst == $src ]; then
11 cp -f -p $src $src.tmp
12 src=$2.tmp
Dees_Troy51a0e822012-09-05 15:24:24 -040013 fi
14
bigbiffad58e1b2020-07-06 20:24:34 -040015 cp $src $dst
16 if [[ -e $2.tmp ]]; then rm -f $2.tmp; fi
Dees_Troy51a0e822012-09-05 15:24:24 -040017}
18
19
20dest=$1
21shift 1
22for ARG in $*
23do
24 process_file $dest $ARG
25done