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