Skip to content

Instantly share code, notes, and snippets.

@jder
Created December 8, 2010 17:09
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 jder/733562 to your computer and use it in GitHub Desktop.
Save jder/733562 to your computer and use it in GitHub Desktop.
#!/bin/bash
TARGET_DIRS="a
b
c"
SOURCE_DIR=src
for TARGET in $TARGET_DIRS; do
xargs -I % cp $SOURCE_DIR/% $TARGET/% <<EOF
foo.txt
bar.txt
sub/baz.txt
EOF
zip -r $TARGET.zip $TARGET
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment