Probably not. The output of a command typically goes directly to the terminal and does not pass through the shell, so the shell has no idea how many lines there are.
You could write a shell where that's not the case, but that would have issues with interactive things - what happens if you run e.g. vim or htop in that context?
You can pipe to `less -F` (`--quit-if-one-screen`), but note that the version of `less` shipped with macOS has a bug and might just swallow the output instead.
``` -F ........ --quit-if-one-screen Quit if entire file fits on first screen. ```
https://gist.github.com/jpouellet/5278239
Mine blinks a little light if a command finishes after 30 seconds, and sends me an email if something takes over a minute.
- automatically have this for any command that outputs more than 10 lines?
- automatically exit when the main command (for example a dev server) exits?
- print the output of the main command to stdout after this is done?