• narshee
    link
    fedilink
    4
    edit-2
    1 year ago

    cat
    while read -r l; do echo "$l"; done <

    cat -e
    while read -r l; do echo "$l"$; done <

    cat -n
    n=0; while read -r l; do n="$((n+1))"; printf '%5d %s\n' "$n" "$l"; done <

    cat -b
    n=0; while read -r l; do [ -n "$l" ] && n="$((n+1))" && printf '%5d %s' "$n" "$l"; echo; done <