Rely on POSIX-compatible head/tail versions that understand the -n option.