That's not built in to the shell in the same way simple overwrite and append are. You have to do it in two steps, first remove the last line, then append:
X=$(head -n -1 filepath)
echo "$X" > filepath
command >> filepath
Or you can overwrite with the new contents all at once:
X=$(head -n -1 test)
(echo "$X"; command) > test
Note that in both cases, we capture the old lines that we want to keep in a variable first as a separate command. This is because as soon as a command with a ">" directive begins executing, the shell will clear the file, and any attempt to read those lines will be too late.