minix/etc/mtree.sh

5 lines
256 B
Bash
Raw Normal View History

2005-04-21 16:53:53 +02:00
#!/bin/sh
cat $1 | while read line
do echo $line | awk 'NF==4 { print "mkdir -p "$4" || exit 1; chmod "$1" "$4" || exit 1; chown "$2" "$4" || exit 1; chgrp "$3" "$4" || exit 1" } NF==3 { print "rm "$1" ; ln -s "$3" "$1" || exit 1" } ' | sh || exit 1
2005-04-21 16:53:53 +02:00
done