From b009381983e3c8adbea883a310cb239a99027933 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Thu, 31 Oct 2024 17:46:22 +0100 Subject: [PATCH] plans: fix done-n --- plans.script.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plans.script.nix b/plans.script.nix index a63d43a..b4d9ac0 100644 --- a/plans.script.nix +++ b/plans.script.nix @@ -18,7 +18,7 @@ pkgs.writeShellScriptBin "plans" '' fi if [ "$1" = "done" ] ; 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 else tail -n"$(($(wc -l < ~/sync/plans.txt) - 1))" ~/sync/plans.txt > ~/plans.txt.tmp