plans: fix done-n

This commit is contained in:
Daniella / Tove 2024-10-31 17:46:22 +01:00
parent f46fc2f042
commit b009381983
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -18,7 +18,7 @@ pkgs.writeShellScriptBin "plans" ''
fi fi
if [ "$1" = "done" ] ; then if [ "$1" = "done" ] ; then
if [ "$2" != "" ] ; then if [ "$2" != "" ] ; then
head -n $2 ~/sync/plans.txt > ~/plans.txt.tmp head -n $(($2 - 1)) ~/sync/plans.txt > ~/plans.txt.tmp
tail -n"$(($(wc -l < ~/sync/plans.txt) - $2))" ~/sync/plans.txt >> ~/plans.txt.tmp tail -n"$(($(wc -l < ~/sync/plans.txt) - $2))" ~/sync/plans.txt >> ~/plans.txt.tmp
else else
tail -n"$(($(wc -l < ~/sync/plans.txt) - 1))" ~/sync/plans.txt > ~/plans.txt.tmp tail -n"$(($(wc -l < ~/sync/plans.txt) - 1))" ~/sync/plans.txt > ~/plans.txt.tmp