Where you specify folders as well, the function I mentioned earlier is likely still your best bet... here is an example...
CORRECTION - adding a -a flag to the copy command in addition to the -t target mentioned above will probably do this. My apologies
- should have verified on the cp man page first.
<code>
function copyme {
if [ -z "$1" ]; then
echo "Only You Have The Force...er Source Rather"
fi
DESTINATION="/var/tmp/";
while( [ ! -z "$1" ] );
do
if [ -d "$1" ]; then
echo "Copying Directory $1 Recursively to $DESTINATION ..."
cp -r "$1" "$DESTINATION" && echo "DONE" || echo "FAILED"
elif [ -r "$1" ]; then
echo "Copying File $1 To $DESTINATION ..."
cp "$1" "$DESTINATION" && echo "DONE" || echo "FAILED"
else
echo "I Can't Read, Let Alone Copy!";
fi
shift
done
}
</code>