Skip to content

Instantly share code, notes, and snippets.

@matthewberryman
Created January 5, 2015 01:46
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 matthewberryman/6409b31bc258d5195d30 to your computer and use it in GitHub Desktop.
Save matthewberryman/6409b31bc258d5195d30 to your computer and use it in GitHub Desktop.
For crawling directories and zipping up all of the associated shape files
#!/bin/bash
while read shp
do
echo Processing $shp
base=`echo $shp | sed "s/\.shp$//"`
zip=${base}.zip
rm -f $zip
zip "$zip" "${base}.shp" "${base}.shx" "${base}.prj" "${base}.dbf"
done < <(find . -name \*.shp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment