wok view 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
line source
1 #!/bin/sh
3 ATTRS=.fatattr
5 cdfat() {
6 fatattr $1 > /dev/null && cd $1
7 }
9 case "${1/--/-}" in
10 -s*) find ${3:-.} -exec fatattr {} \; > ${2:-$ATTRS} ;;
11 -r*) while read line; do
12 fatattr $(echo ${line:0:9} | sed 's/[^ ]/+\0 /g') "$3${line:9}"
13 done < ${2:-$ATTRS} ;;
14 -c*) cdfat ${2:-.} && $0 -s && find . | cpio -o -H newc ;;
15 -[xe]*) cdfat ${2:-.} && cpio -idmu && $0 -r && rm -f $ATTRS ;;
16 *) cat 1>&2 <<EOT
17 Usage: $0 [--save|--restore] [datafile] [root]
18 $0 [--create-cpio|--extract-cpio] [root]
19 EOT
20 esac