lines()
zouhair opened this issue · 2 comments
zouhair commented
lines() {
# Usage: lines "file"
mapfile -tn 0 lines <<<"$1"
# instead of < "$1"
printf '%s\n' "${#lines[@]}"
}
dylanaraps commented
Could I have some more information? Possible a rationale for this snippet?
zouhair commented
Forget about it, I am dumb