blob: 59171146f8db58c09aadf54d541e8be8df2bdb04 [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
bigbiff948f3962022-07-18 15:55:03 -040015 mkdir -p $1
bigbiffad58e1b2020-07-06 20:24:34 -040016 cp $src $dst
17 if [[ -e $2.tmp ]]; then rm -f $2.tmp; fi
Dees_Troy51a0e822012-09-05 15:24:24 -040018}
19
20
21dest=$1
22shift 1
23for ARG in $*
24do
25 process_file $dest $ARG
26done