diff --git a/sync-history.sh b/sync-history.sh index 23b5790..0e92918 100755 --- a/sync-history.sh +++ b/sync-history.sh @@ -68,7 +68,7 @@ if (( current_time - last_executed_time >= 30 )) || [ "$force_sync" = "-f" ]; th fi source_items=$(read_file $source_file) - items=$(echo -e "$new_items\n$source_items" | grep -v '^\:\s[<=>]\{3\}' | awk '!x[$0]++') + items=$(echo -e "$new_items\n$source_items" | grep -v '^\:\s[<=>]\{3\}' | awk '!x[$0]++' | sort -t ';' -k1,1) echo -e "$items" > $source_file echo -e "$items" | $GPG_CMD --encrypt --trust-model always --yes --recipient "$ZSH_HISTORY_SYNC_GPG_KEY_UID" --output "$sync_file" 2>/dev/null