1count(1) fish count(1)
2
3
4
6 count - "count - Count the number of elements of an array"
7
8 Synopsis
9 count $VARIABLE
10
11 Description
12 count prints the number of arguments that were passed to it. This is
13 usually used to find out how many elements an environment variable
14 array contains, but this is not the only potential usage for the count
15 command.
16
17 The count command does not accept any options, not even '-h'. This way
18 the user does not have to worry about an array containing elements such
19 as dashes. fish performs a special check when invoking the count
20 program, and if the user uses a help option, this help page is
21 displayed, but if a help option is contained inside of a variable or is
22 the result of expansion, it will be passed on to the count program.
23
24 Count exits with a non-zero exit status if no arguments where passed to
25 it, with zero otherwise.
26
27 Example
28 count $PATH
29
30 returns the number of directories in the users PATH variable.
31
32 count *.txt
33
34 returns the number of files in the current working directory ending
35 with the suffix '.txt'.
36
37
38
39Version 1.21.12 4 Sep 2006 count(1)