dylanaraps / pure-bash-bible

📖 A collection of pure bash alternatives to external processes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lines()

zouhair opened this issue · comments

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

commented

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

Forget about it, I am dumb