From cee6d187e4507bdc0af83f7ccf8a314bf897767e Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Tue, 3 Dec 2013 19:38:09 +0100 Subject: [PATCH] add res[et] command to sql/builder.sh script with del+ins commands integrated in a single command --- sql/builder.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/builder.sh b/sql/builder.sh index 83843d3..2f0e60c 100755 --- a/sql/builder.sh +++ b/sql/builder.sh @@ -16,6 +16,7 @@ usage () { echo " piped" echo " add [ [..]]" echo " del [ [..]]" + echo " res [ [..]]" echo " dump [dumpfile]" echo " dumpall [dumpfile]" echo " all" @@ -101,7 +102,7 @@ test "$DBUSER" != "" && pg_args="$pg_args -U $DBUSER" test "$DBPORT" != "" && pg_args="$pg_args -p $DBPORT" test "$DBBASE" != "" && pg_args="$pg_args $DBBASE" -MATCH_DROP='^drop|^alter table.* drop ' +MATCH_DROP='^drop|^alter table.* drop |^delete ' case $CMD in "create") @@ -151,6 +152,9 @@ case $CMD in "del") ( echo "-- MESG: del start" ; cat "$@" | egrep -i "$MATCH_DROP" | tac ; echo "-- MESG: del end" ; ) | sqlexe ;; + "res") + ( echo "-- MESG: res start" ; cat "$@" | egrep -i "$MATCH_DROP" | tac ; cat "$@" | egrep -iv "$MATCH_DROP" ; echo "-- MESG: del end" ; ) | sqlexe + ;; "help"|"-h"|"--help") usage 0 ;; -- 2.17.1