From f5a85bccf9d99d8489cb57f88f3b2c4ad69ae9c3 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Wed, 2 Dec 2015 08:13:40 +0100 Subject: [PATCH] numeric sort for sql.d files --- sql/builder.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/builder.sh b/sql/builder.sh index 2bb9917..f67fa23 100755 --- a/sql/builder.sh +++ b/sql/builder.sh @@ -55,11 +55,11 @@ one_or_all() { if [ "$1" ]; then echo "$1" elif [ "$TYPE_FILES" = "a" ]; then - find sql.d/ -name '[0-9]*' -type f | tr '\n' ' ' + find sql.d/ -name '[0-9]*' -type f | sort -n | tr '\n' ' ' elif [ "$TYPE_FILES" = "d" ]; then - find sql.d/ -name '[0-9]*' | egrep '.*_devel.sql$|^[^_]+.sql$' | tr '\n' ' ' + find sql.d/ -name '[0-9]*' | egrep '.*_devel.sql$|^[^_]+.sql$' | sort -n | tr '\n' ' ' else - find sql.d/ -name '[0-9]*' | egrep '^[^_]+.sql$' | tr '\n' ' ' + find sql.d/ -name '[0-9]*' | egrep '^[^_]+.sql$' | sort -n | tr '\n' ' ' fi); do echo "-- FILE BEG: $fil" cat "$fil" -- 2.17.1