summaryrefslogtreecommitdiffstats
path: root/skripti/odstrani-datum-komentarjev-docx.sh
blob: 41a18712a339ca6d47f4ce68b3e573e9a60a93b7 (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 -i 's/ w:date="[^"]*"//g' $t/word/comments.xml
sed -i '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