Skip to main content
2 of 4
edited body
Costas
  • 15k
  • 24
  • 38

The main idea is to prepare string with the list of files to operate (even through the loop) than transfer the string to command:

sloc='[email protected]:/some/location/'
flist=( $(for i in "$@" ; do printf '"%s" ' "$sloc$i/$i".{pdf,txt} ; done ) )
scp ${flist[*]} /somewhere/else/
Costas
  • 15k
  • 24
  • 38