mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-19 08:02:45 +08:00

As a simple replacement for `wc -l`. This counts both lines on stdin _and_ arguments. So if "file" has three lines, then `count a b c < file` will print 6. And since it counts newlines, like wc, `echo -n foo | count` prints 0.
19 lines
238 B
Plaintext
19 lines
238 B
Plaintext
|
|
####################
|
|
# no args
|
|
|
|
####################
|
|
# one args
|
|
|
|
####################
|
|
# two args
|
|
|
|
####################
|
|
# args that look like flags or are otherwise special
|
|
|
|
####################
|
|
# big counts
|
|
|
|
####################
|
|
# stdin
|