Skip to content

Commit

Permalink
Use perl instead of sed when replacing IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
andersju committed Nov 18, 2024
1 parent 4eaf8c8 commit ddafe45
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 ddafe45

Please sign in to comment.