- if [ "$1" ]; then
- cat "$1"
- elif [ "$TYPE_FILES" = "a" ]; then
- cat sql.d/[0-9]*
- elif [ "$TYPE_FILES" = "d" ]; then
- cat sql.d/[0-9]*.{sql,devel}
- else
- cat sql.d/[0-9]*.sql
- fi
+ local old_ifs
+
+ old_ifs="$IFS"
+ IFS=" "
+ for fil in $(
+ if [ "$1" ]; then
+ echo "$1"
+ elif [ "$TYPE_FILES" = "a" ]; then
+ echo sql.d/[0-9]*
+ elif [ "$TYPE_FILES" = "d" ]; then
+ echo sql.d/[0-9]*.{sql,devel}
+ else
+ echo sql.d/[0-9]*.sql
+ fi); do
+ echo "-- FILE BEG: $fil"
+ cat "$fil"
+ echo "-- FILE END: $fil"
+ done
+ IFS="$old_ifs"