1. Bash interpretor will not run into your functions directly. As you have it right now, the interpretor bypasses your functions.
You have to invoke your function explicitely from the script. Add wherecpy at the end of your script.
2. As you have it right now, only one parameter will be added to 'cp' command.
You need something like this in funcpy function:
Code:
<here the user input>
flags=""
if [[ $selection = *1* ]]
then
flag="$flag -i"
fi
if [[ $selection = *2* ]]
then
flag="$flag --backup"
fi
if [[ $selection = *3* ]]
then
flag="$flag --preserve=all"
fi
if [[ $selection = *4* ]]
then
flag="$flag -r"
fi
if [[ $selection = *5* ]]
then
return 0
fi
...
...
...
cp $flag "$file" "$dest"