Skip to content

Instantly share code, notes, and snippets.

@pepoviola
Created May 18, 2015 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pepoviola/28be1dc2205d0f37dd2b to your computer and use it in GitHub Desktop.
Save pepoviola/28be1dc2205d0f37dd2b to your computer and use it in GitHub Desktop.
# get data from file m.map
# this file has the map sourceName, destName
#i.e:
#/source/A.jpg,/dest/B.jpg
# split with awk and create an array, the use the array to scp
for i in $(cat m.map); do A=($(echo ${i}|awk -F"," '{print $1" "$2}'));scp ${A[0]} 1.1.1.1:${A[1]};done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment