dylanaraps/pure-bash-bible

lines()

zouhair opened this issue · 2 comments

lines() {
    # Usage: lines "file"
    mapfile -tn 0 lines <<<"$1"
   # instead of < "$1"
    printf '%s\n' "${#lines[@]}"
}

Could I have some more information? Possible a rationale for this snippet?

Forget about it, I am dumb