projects
/
blog.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
posts:One-off_Git_daemon: Add post describing ad-hoc usage
[blog.git]
/
posts
/
MPD
/
mpc-stop-after-n-songs.sh
1
#!/bin/bash
2
3
LAST_SONG=$(mpc current)
4
REMAINING="${1:-1}"
5
6
echo "${REMAINING} ${LAST_SONG}"
7
while [ "${REMAINING}" -gt 0 ]; do
8
SONG=$(mpc current --wait)
9
if [ "${SONG}" != "${LAST_SONG}" ]; then
10
let "REMAINING -= 1"
11
LAST_SONG="${SONG}"
12
echo "${REMAINING} ${LAST_SONG}"
13
fi
14
done
15
16
mpc stop