17 lines
256 B
Bash
Executable file
17 lines
256 B
Bash
Executable file
#! /bin/zsh
|
|
|
|
SRCDIR="$1"
|
|
DESTDIR="$2"
|
|
|
|
pushd "${SRCDIR}" > /dev/null
|
|
find . -type d | while read P
|
|
do
|
|
mkdir -p "${DESTDIR}/${P[3,-1]}"
|
|
done
|
|
|
|
find . -type f | while read P
|
|
do
|
|
P="${P[3,-1]}"
|
|
cp -bv "${P}" "${DESTDIR}/${P}"
|
|
done
|
|
popd > /dev/null
|