Please i need help for understanding funcions

It’s obvious, the result of the fetch is not one “script” that you can provide to execute…

the rapid soluction for this case is this, but is not longer “a function”…
{
:local aIP “10.50.0.191”
:local aID “Test”
:local logftp “ftp/$aID_ftp.log”

:local UPL do={ }

:execute file=$logftp script=“/tool fetch upload=yes url="sftp://$aIP/dude_rsa.pub" src-path="server.pub" user="admin-ssh" keep-result=no”
}
One example to manage fetch results:
http://forum.mikrotik.com/t/fetch-capable-of-following-redirects/151723/7