Extracting the trainees’ files and packaging them

| -Uncategorized

Shell scripting to the rescue!

# Zip their work up
for DIR in *; do ( cd $DIR; zip perl-day1.zip * ); done

# Realize that I have to get rid of the archives temporarily because
# I might want to insert all the files into a buffer, so back it up first
tar zcvf archive.tar.gz $(find -name \*.zip)

# Remove all the zip files
find -name \*.zip -exec rm {} \;
You can comment with Disqus or you can e-mail me at sacha@sachachua.com.