mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Actually add the count function. Thanks to Tassilo Horn for the report.
darcs-hash:20070424153317-ac50b-f6ab71ad0ea9d74351169d18f1dc856a442ee3f4.gz
This commit is contained in:
parent
c00e1fcf26
commit
52e7a7ec1c
1 changed files with 11 additions and 0 deletions
11
share/functions/count.fish
Normal file
11
share/functions/count.fish
Normal file
|
@ -0,0 +1,11 @@
|
|||
|
||||
function count --description "Count the number of elements of an array"
|
||||
set -l lines ''
|
||||
set result 1
|
||||
for i in $argv
|
||||
set lines $lines\n
|
||||
set result 0
|
||||
end
|
||||
echo -n $lines|wc -l
|
||||
return $result
|
||||
end
|
Loading…
Reference in a new issue