wok-6.x annotate fatattr/stuff/fatattr.sh @ rev 14781
Add some licenses
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jul 05 13:51:55 2013 +0200 (2013-07-05) |
parents | |
children | 46a4ae996aa7 |
rev | line source |
---|---|
pascal@14781 | 1 #!/bin/sh |
pascal@14781 | 2 |
pascal@14781 | 3 ATTRS=.fatattr |
pascal@14781 | 4 |
pascal@14781 | 5 cdfat() { |
pascal@14781 | 6 fatattr $1 > /dev/null && cd $1 |
pascal@14781 | 7 } |
pascal@14781 | 8 |
pascal@14781 | 9 case "${1/--/-}" in |
pascal@14781 | 10 -s*) find ${3:-.} -exec fatattr {} \; > ${2:-$ATTRS} ;; |
pascal@14781 | 11 -r*) while read line; do |
pascal@14781 | 12 fatattr $(echo ${line:0:9} | sed 's/[^ ]/+\0 /g') "$3${line:9}" |
pascal@14781 | 13 done < ${2:-$ATTRS} ;; |
pascal@14781 | 14 -c*) cdfat ${2:-.} && $0 -s && find . | cpio -o -H newc ;; |
pascal@14781 | 15 -[xe]*) cdfat ${2:-.} && cpio -idmu && $0 -r && rm -f $ATTRS ;; |
pascal@14781 | 16 *) cat 1>&2 <<EOT |
pascal@14781 | 17 Usage: $0 [--save|--restore] [datafile] [root] |
pascal@14781 | 18 $0 [--create-cpio|--extract-cpio] [root] |
pascal@14781 | 19 EOT |
pascal@14781 | 20 esac |
pascal@14781 | 21 |