I have a bash function (slightly simplified for explaining)
copy_to() {
cp $1 $2 $3
}
This works fine:
copy_to -f /demo/example1.xml new_demo/
But Let's say I want to copy all the xml files, the following code will have issues:
copy_to -f /demo/*.xml new_demo/
Obviously I could just write cp -f /demo/*.xml new_demo/
, but is there anyway to get the copy_to function to work for a list of files (which passes more than just 3 parameters) as well as a single file?