Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # documentinfo, gives document info about a LibreOffice document.
- # Created: 2012-02-19
- #
- # uses: xml, from http://xmlstar.sourceforge.net/
- #
- if [ ! -e $1 ] || [[ "$1" == "" ]]; then
- echo "Usage: `basename $01` <filename>"
- exit 1
- fi
- if [ -e "meta.xml" ]; then
- echo "Sorry, this cannot be done because some 'meta.xml' already exists"
- else
- # extract 'meta.xml' from the inputfile
- unzip -qo $1 meta.xml
- for f in `xml el meta.xml`;
- do
- n=${f/*:}
- if [[ ! "$n" =~ "meta" ]]; then
- w=`xml sel -t -v "$f" meta.xml`
- echo "$n: $w"
- fi
- done
- rm meta.xml
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement