10
# Decode the options given in parameters
12
IGNORE_FOLDER_REGEXP=""
14
for opt in $options; do
17
IGNORE_FILE_REGEXP=$(echo $opt | sed -e "s/^ignore_file=\(.*\)$/\1/")
20
IGNORE_FOLDER_REGEXP=$(echo $opt | sed -e "s/^ignore_folder=\(.*\)$/\1/")
27
# This function filter the file to ignore according to the regexp given in
33
if [ -z "$ignore_regexp" ] || [ "$(printf "$line" | sed -e "s/'$//" | egrep "$ignore_regexp")" = "" ]; then
39
# This function create a shell script that will generate the structure of
41
generate_folder_structure() {
42
$FIND $DIR -type d -exec echo "mkdir -p '{}'" \; | filter_ignore $IGNORE_FOLDER_REGEXP
44
$FIND $DIR -type d -exec $STAT --format "chown %U '{}'" {} \; | filter_ignore "$IGNORE_FOLDER_REGEXP"
45
$FIND $DIR -type d -exec $STAT --format "chgrp %G '{}'" {} \; | filter_ignore "$IGNORE_FOLDER_REGEXP"
46
$FIND $DIR -type d -exec $STAT --format "chmod %a '{}'" {} \; | filter_ignore "$IGNORE_FOLDER_REGEXP"
49
generate_folder_structure