Skip to content

Instantly share code, notes, and snippets.

@seumasmorrison
Created June 11, 2013 15:16
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 seumasmorrison/5757713 to your computer and use it in GitHub Desktop.
Save seumasmorrison/5757713 to your computer and use it in GitHub Desktop.
For iterating over zipped months of buoy data and extracting out the history files.
unzip_his() { for line in $(unzip -l $1 \
| grep his \
| awk '{print $4}');
do
echo $1 $line
unzip -p $1 $line > $(echo $line | sed -re 's/^.+\///');
done
}
for zip in "$@"
do
unzip_his "$zip"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment