summaryrefslogtreecommitdiffstats
path: root/skripti/odstrani-datum-komentarjev-docx.sh
blob: 28517f9c49ccf9c1a3ef0d7787c130b78f071cd2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
set -xe
p=`rev <<<$0 | cut -d/ -f1 | rev`
t=`mktemp -p "" -d $p.XXX`
unzip $1 -d$t
sed -ie 's/ w:date="[^"]*"//g' $t/word/comments.xml
sed -ie 's/ w16cex:dateUtc="[^"]"//g' $t/word/commentsExtensible.xml
b=`rev <<<$1 | cut -d/ -f1 | cut -d. -f2- | rev`
d=`mktemp -p "" $b.XXX.docx`
rm $d # hack that causes race condition
cd $t
zip -r $d *
cd $OLDPWD
rm -r $t
echo $d