In general, composing Unix commands is a very powerful means to construct complex applications... poorly, with no real pathways to fixing their shortcomings. I believe the traditional "Unix Way" is to gloss over said shortcomings and pretend they don't exist, and when that fails, move the goalposts and argue that they don't exist "in the real world".
For example, what combination of shell commands can I use to output the number of files in a directory?
For example, what combination of shell commands can I use to output the number of files in a directory?
Hint: it's a trick question, you can't.