Browse Source

Replace head -n-1 with POSIX-compatible sed '$d'

The GNU-specific head -n-1 syntax causes errors on macOS/BSD systems.
Replaced with sed '$d' which is POSIX-compatible and achieves the same
result of removing the last line.
pull/1031/head
Erik Cervin-Edin 5 months ago
parent
commit
3a36c660e1
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      bin/mailsync

+ 1
- 1
bin/mailsync View File

@@ -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" |


Loading…
Cancel
Save