Introduce utility function 'count', inspired by the fish builtin, which simply echoes the number of arguments it receives (e.g., count *.txt)

This commit is contained in:
Danielle McLean 2020-03-26 11:34:51 +11:00
parent fae6274ef7
commit c924183b37
Signed by: 00dani
GPG key ID: FF6F9216852288FF
2 changed files with 3 additions and 0 deletions

View file

@ -2,5 +2,6 @@
# autoloaded functions must be declared in every kind of zsh: they aren't
# inherited in the environment so non-login shells need them, and you'll want
# to call one in a script so non-interactive shells need them.
autoload count
autoload enphp
autoload -Uz zargs zmv

View file

@ -0,0 +1,2 @@
#! zsh
echo $#