From 3c6a1bb6eaa81fa62b4904568cd2a31cb1d82c27 Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Wed, 18 Dec 2019 16:33:12 +0100 Subject: [PATCH] Fissato bachetto --- mastblocksdump/mastblocksmerge.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mastblocksdump/mastblocksmerge.sh b/mastblocksdump/mastblocksmerge.sh index 1e14e27..d793337 100755 --- a/mastblocksdump/mastblocksmerge.sh +++ b/mastblocksdump/mastblocksmerge.sh @@ -159,10 +159,10 @@ if [ $INTERACTIVE -eq 1 ]; then [ $? -eq 0 ] && ask=0 done if [ "$inp" == "" ] || [ "$inp" == "s" ] || [ "$inp" == "S" ]; then - buf+="$line" + buf+="$line$IFS" fi done - newblocks="$buf" + newblocks=$(echo "$buf" | head -n -1) fi echo "$newblocks" | PGPASSWORD="$DB_PASS" psql -h "$DB_HOST" -p "$DB_PORT" -d "$DB_NAME" -U "$DB_USER" -A -t -c "COPY domain_blocks ( domain, created_at, updated_at, severity, reject_media, reject_reports, public_comment ) FROM STDIN WITH ( FORMAT text, DELIMITER ' ' )"