Iterate over a list of IPv6 Addresse in a Bash Script for loop-Collection of common programming errors
Try using
file_"${X//:/_}".xml
in order to replace all :
with _
.
If your files are already named this way and this shouldn’t change,
file_"${X//:/\\:}".xml
can be used as well. But I’m not sure if scp
does recognize this appropriately.
Besides that, the scp
manpage contains
File names may contain a user and host specification to indicate that the file is to be copied to/from that host. Local file names can be made explicit using absolute or relative pathnames to avoid scp treating file names containing ‘:’ as host specifiers. Copies between two remote hosts are also permitted.
So just using ./file_"${X}".xml
should work as well.