#!/bin/sh
error="true"
name1="$1"
name2="$2"
dir1=""
dir2=""
if test -d "$1"; then
    dir1="$1/"
    name1="$2"
    if test $# -eq 4; then
	dir2="$3/"
	name2="$4"
    elif test $# -eq 3; then
	name2="$3"
    fi
elif test -d "$2"; then
    dir2="$2/"
    if test $# -eq 3; then
	file2="$3"
    else
	file2="$1"
    fi
fi
for prefix in b s d c; do
    file1="$dir1$prefix.$name1"
    file2="$dir2$prefix.$name2"
    if cp "$file1" "$file2" 2> /dev/null; then
	echo "Copying $file1 to $file2 ... done"
        unset error
    fi
done
if test -n "$error"; then
    echo "Copying: no files found for $dir1[bsdc].$name1 and $dir2[bsdc].$name2"
fi
