Fix macOS compatibility in kiwix torrent sync script
BSD head (macOS) doesn't support negative line counts like GNU head. Use `sed '$d'` instead of `head -n -1` to remove the last line. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ce6c5b6b37
commit
53a0bf5813
1 changed files with 2 additions and 1 deletions
|
|
@ -16,7 +16,8 @@ if [[ ! -f "$TORRENT_LIST" ]]; then
|
|||
fi
|
||||
|
||||
# Get current torrents from transmission (extract names, skip header/footer)
|
||||
current_torrents=$(transmission-remote -l 2>/dev/null | tail -n +2 | head -n -1 | awk '{print $NF}' || true)
|
||||
# Note: Use sed '$d' instead of head -n -1 for macOS compatibility
|
||||
current_torrents=$(transmission-remote -l 2>/dev/null | tail -n +2 | sed '$d' | awk '{print $NF}' || true)
|
||||
|
||||
added=0
|
||||
skipped=0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue