blob: 59171146f8db58c09aadf54d541e8be8df2bdb04 [file] [log] [blame]
#!/bin/bash
process_file()
{
dst=$1/$(basename $2)
src=$2
[[ -e $src ]] || return 0
if [ $dst == $src ]; then
cp -f -p $src $src.tmp
src=$2.tmp
fi
mkdir -p $1
cp $src $dst
if [[ -e $2.tmp ]]; then rm -f $2.tmp; fi
}
dest=$1
shift 1
for ARG in $*
do
process_file $dest $ARG
done