#!/bin/bash
# A script for extracting Microsoft Word Documents from zips in a directory.
# Copyright (C) 2017, Trisquel Fora user Soon.to.be.Free
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# If you are using GNU/Linux, you should have received a copy of the GNU General Public License
# along with your operating system. If not, or if you are using a different operating system,
# see <http://www.gnu.org/licenses/>.
WS_EXTRE="\.doc$|\.docx$"
WS_DIREXT=""
find . -name "*.zip" -type f -print | while read WS_FILE;
do
echo "Handling Archive ${WS_FILE}..."
echo
echo
echo
echo \{`unzip -Z1 "$WS_FILE"`\}
echo \{
unzip -Z1 "$WS_FILE" | egrep "$WS_EXTRE" | while read WS_EXTFILE;
do
echo "${WS_EXTFILE}"
done
echo \}
done