Skip to content

Instantly share code, notes, and snippets.

@a2ndrade
Last active October 10, 2015 12:38
Show Gist options
  • Save a2ndrade/3691373 to your computer and use it in GitHub Desktop.
Save a2ndrade/3691373 to your computer and use it in GitHub Desktop.
# copy files preserving path; ae|web => source dirs; patch => target dir
for f in `git log --name-only -1 | awk /ae\|web/`; do find . -regex "./$f" -type f -exec cp --parents "{}" patch \;; done
# for-loop
for i in `seq 1 10`; do echo $i; done
# for-each + counter
c=10; for i in `seq 1 10`; do echo "$i => $c"; c=$[c+1]; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment