Am 23.12.22 um 13:08 schrieb Dave:
> Moin Semmel, morgen Matthias,
>
> vielen Dank für eure Hinweise. Tatsächlich gibt es dieses wirklich sehr
> nützliche Programm leider nur für Windows.
Für linux brauchts kein Program :)
------8<------
Als Beispiel
Shell Script 'getcreationdate'
#!/bin/bash
help() {
echo "$0
Script um das Datum einer OpenDocument-Datei (odt) auf das
in den Meta-Daten (Eigenschaften) der Datei gespeicherte Datum
festzulegen.
Syntax:
In dem Verzeichnis in dem sich die Datei befindet: $0 <Dateiname>
$1
(c) 23.12.2022 bernd obermayr
"
exit 0
}
if [ X$1 = "X" -o "X$1" = "X-h" ]; then
help
fi
if [ X$1 = "X" -o ! -f "$1" ]; then
help " Fehler: Die Datei $1 existiert nicht"
fi
tmp1=$(mktemp -d /tmp/$(basename ${0})_XXXXXX)
orgPath=`pwd`
file="${orgPath}/$1"
pushd $tmp1
unzip "$file"
cdate=$(xmlstarlet sel -t -v "//meta:creation-date" meta.xml)
echo "$file creation-date=$cdate"
touch -d $cdate "$file"
popd
rm -rf $tmp1
--
Gruss
Bernd
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]