mirror of
https://github.com/kneutron/ansitest.git
synced 2025-01-16 04:42:55 +08:00
Add files via upload
This commit is contained in:
parent
c1c5622b09
commit
576c1dad6c
31
OSX/osx-extended-metadata-attributes-hfsplus.sh
Normal file
31
OSX/osx-extended-metadata-attributes-hfsplus.sh
Normal 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user