Skip to content

Commit

Permalink
Merge pull request #1521 from libris/feature/replace-sed-with-perl
Browse files Browse the repository at this point in the history
Use perl instead of sed when replacing IDs
  • Loading branch information
andersju authored Nov 18, 2024
2 parents 9177045 + ddafe45 commit d0708fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions librisxl-tools/scripts/move-lddb-from-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ else
}
fi

REPLACEID="s!\(\(\"@id\": \"\|\t\)https://libris\)\(-\w\+\)\?\(.kb.se/[bcdfghjklmnpqrstvwxz0-9]\+\)\>!\1-$DESTENV\4!g"
REPLACEID="s/((@id\": \"|\t)https:\/\/libris)(?:-\w+)?(.kb.se\/[bcdfghjklmnpqrstvwxz0-9]+)\b/\1-$DESTENV\3/g"

pg_restore -f - "${DUMPPATH}" |
( read; cat - |
sed "$REPLACEID" |
perl -pe "$REPLACEID" |
handle_sql_dump )

0 comments on commit d0708fa

Please sign in to comment.