mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08: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
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…
x
Reference in New Issue
Block a user