I want to copy multiple files from one server to another and I have to do it using scp from server to local then local to the server.
I created an alias function for the same using this answer
alias copy_file='function _copy(){ scp tarun@server1.com:/path_to_folder/"$1" ./ && scp "$1" tarun@server2.com:/path_to_folder/ ; };_copy'
It works for single file like this
copy_file temp1
But when I try to copy multiple files like this explained here
copy_file {temp1,temp2}
It only copies the first file
However, when I run the alias command directly it copies both the file. Like this:
scp tarun@server1.com:/path_to_folder/{temp1,temp2} ./ && scp {temp1,temp2} tarun@server2.com:/path_to_folder/
Please help.