WizardKit/archlive/airootfs/usr/local/bin/msword-search
Alan Mason 10a70e5192 2016-04: Retroactive Updates
* Added HFS+ to udevil's allowed types.
* Added mediainfo to meet photorec-sort requirements
* Removed git
* Switched out Chromium for Midori
  * Size reduction test
* hw-diags now tests USB drives (except ARCH drives)
* mount-all-volumes no longer opens the file browser

Bugfix: mount-backup-shares should now work.
2017-12-06 17:44:12 -08:00

30 lines
611 B
Bash

#!/bin/bash
IFS=$'\n'
for s in $*; do
REGEX="$s"
REGEX=$(echo "$REGEX" | sed -r 's/\s+/\\s\*/g')
# Word Doc
for d in *doc; do
if antiword "$d" | grep -iqsP "($REGEX)"; then
echo "Possible match: $d"
echo "$d" >> msword.tmp
fi
done
# Word Docx
for d in *docx; do
if unzip -p "$d" word/document.xml | grep -iqsP "($REGEX)"; then
echo "Possible match: $d"
echo "$d" >> msword.tmp
fi
done
done
# Cleanup results
if [[ -f msword.tmp ]]; then
sort -u msword.tmp >> msword-matches.txt
fi