misc: cleanup

This commit is contained in:
Dylan Araps
2018-06-16 09:19:11 +10:00
parent 4be5a150f9
commit e11ac48306

View File

@@ -759,7 +759,7 @@ Alternative to `wc -l`.
```sh ```sh
lines() { lines() {
# Usage lines "file" # Usage: lines "file"
mapfile -tn 0 lines < "$1" mapfile -tn 0 lines < "$1"
printf '%s\n' "${#lines[@]}" printf '%s\n' "${#lines[@]}"
} }
@@ -772,7 +772,7 @@ compatible but it's slower for bigger files.
```sh ```sh
lines_loop() { lines_loop() {
# Usage lines_loop "file" # Usage: lines_loop "file"
count=0 count=0
while IFS= read -r _; do while IFS= read -r _; do
((count++)) ((count++))
@@ -1367,4 +1367,3 @@ ls
# command # command
command ls command ls
``` ```