summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2026-06-29 23:06:14 -0400
committerGitHub <noreply@github.com>2026-06-29 23:06:14 -0400
commiteadb1ceb7ac67f4f1b37efae3fccd1c331a8af4c (patch)
tree241b0a6318689dbbc9b66119c2e3b3fe68a9e5c4
parent55020ae84dd678d1681618f991c2027449e7d39e (diff)
parent3a36c660e17df6296b8f042772780764f0e9a7d2 (diff)
Merge pull request #1031 from CervEdin/fix-posix-head
Replace head -n-1 with POSIX-compatible sed '$d'
-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" |