Line number exit outpu command ?
gpxlnx opened this issue · comments
Guilherme Xavier commented
Hey guys,
Is there any way to display, for example, the number of lines in the output of a command?
Ex.
$ ls
1 file1
2 arch2
3 arch3
Michael Diamond commented
There's the nl
command, or equivalently a custom bit of Bash could do the same in a few lines, but I don't think there's any way to hook into the pipeline like this at the time(s) bash-preexec is running without somehow modifying the command itself.