Add files via upload

This commit is contained in:
kneutron 2022-05-05 14:06:23 -05:00 committed by GitHub
parent c1c5622b09
commit 576c1dad6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,31 @@
#!/bin/bash
# REF: https://apple.stackexchange.com/questions/85699/any-risks-in-creating-custom-os-x-extended-attributes
# store *sum information along with the file for future backup/comparison
if [ "$1" = "" ]; then
outf=metadata-test
cd /tmp
else
outf="$1"
fi
[ "$outf" = "metadata-test" ] && echo "thys be randome texte" >$outf
#ls -alh $outf
# see ' man xattr '
# copy the md5sum for the file to its own metadata
xattr -w md5 $(md5sum $outf |awk '{print $1}') $outf
#79a6a33cf17bf7550486c58836928193 metadata-test
# ^ md5sum output
#xattr -l $outf
#md5: 79a6a33cf17bf7550486c58836928193
xattr -w sha1 $(sha1sum $outf |awk '{print $1}') $outf
set -x
xattr -l $outf
ls -lh@ $outf