# functions
usage () {
echo " USAGE"
- echo " ./builder <command> [-d|--dryrun] [-a|-p|--allfiles|--devfiles] [-s|--short] ..."
- echo " ./builder <-h|--help|help>"
+ echo " $0 <command> [-d|--dryrun] [<-a|--allfiles>|<-p|--devfiles>] [-s|--short] ..."
+ echo " $0 <-h|--help|help>"
echo " commands are:"
echo " create"
echo " destroy"
if [ "$1" ]; then
echo "$1"
elif [ "$TYPE_FILES" = "a" ]; then
- echo sql.d/[0-9]*
+ find sql.d/ -name '[0-9]*' -type f | sort -n | tr '\n' ' '
elif [ "$TYPE_FILES" = "d" ]; then
- echo sql.d/[0-9]*.{sql,devel}
+ find sql.d/ -name '[0-9]*' | egrep '.*_devel.sql$|^[^_]+.sql$' | sort -n | tr '\n' ' '
else
- echo sql.d/[0-9]*.sql
- fi); do
+ find sql.d/ -name '[0-9]*' | egrep '^[^_]+.sql$' | sort -n | tr '\n' ' '
+ fi); do
echo "-- FILE BEG: $fil"
cat "$fil"
echo "-- FILE END: $fil"