rcaloras / bash-preexec

⚡ preexec and precmd functions for Bash just like Zsh.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Line number exit outpu command ?

gpxlnx opened this issue · comments

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

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.