summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2018-02-18 14:47:11 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-02-18 14:47:11 +0100
commit39cda256dae815015400fc32d0f288dd55977fb5 (patch)
treeb3c87ef019cb50a9c16f62cab81e03a39c520c8f
parent0c6ca5aa4191aef9a19cc38db4eabf9009f36d08 (diff)
sfeed_update: dont allow TAB in filename (messes up the merge logic)
-rwxr-xr-xsfeed_update6
1 files changed, 4 insertions, 2 deletions
diff --git a/sfeed_update b/sfeed_update
index 2977bdc..b3aa0da 100755
--- a/sfeed_update
+++ b/sfeed_update
@@ -31,11 +31,13 @@ loadconfig() {
# merge raw files.
# merge(oldfile, newfile)
merge() {
+ oldfile="$(printf '%s' "$1" | tr ' ' ' ')"
+ newfile="$(printf '%s' "$2" | tr ' ' ' ')"
# unique check by id, title, link.
# print only new entries in newfile.
# order new items by timestamp (asc).
- (sed 's@^@O @' "$1"
- sed 's@^@N @' "$2") | \
+ (sed 's@^@O @' "${oldfile}"
+ sed 's@^@N @' "${newfile}") | \
LC_ALL=C awk '!x[$7 " " $3 " " $4]++ && $1 == "N"' 2>/dev/null | \
cut -f 2- | \
sort -t ' ' -k1n,1