summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPontus Karlsson <pontus@sent.com>2025-07-16 13:12:31 +0200
committerPontus Karlsson <pontus@sent.com>2025-07-16 13:12:31 +0200
commitdf69b30e61839eec13b6031673fc366a5f1abd5a (patch)
tree97751c39f708d356caf756ba8351ad11c776165f
parentb7b7f21d692048f34287615312ebc9385cd3c378 (diff)
fix: `head` incompatibility between GNU and macOS
-rwxr-xr-xbin/mailsync2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/mailsync b/bin/mailsync
index 3a681f0..7114836 100755
--- a/bin/mailsync
+++ b/bin/mailsync
@@ -74,7 +74,7 @@ syncandnotify() {
[ -z "$MAILSYNC_MUTE" ] &&
for file in $new; do
# Extract and decode subject and sender from mail.
- subject=$(awk '/^Subject: / && ++n == 1,/^.*: / && ++i == 2' "$file" | head -n-1 |
+ subject=$(awk '/^Subject: / && ++n == 1,/^.*: / && ++i == 2' "$file" | sed '$d' |
perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' |
sed 's/^Subject: //' | tr -d '\n\t')
from="$(sed -n "/^From:/ s|From: *|| p" "$file" |