@sebastiancarlos to Linux@lemmy.ml • edit-21 year agocat vs sed vs awklemmy.sdf.orgimagemessage-square22arrow-up162arrow-down11
arrow-up161arrow-down1imagecat vs sed vs awklemmy.sdf.org@sebastiancarlos to Linux@lemmy.ml • edit-21 year agomessage-square22
minus-squarenarsheelinkfedilink4•edit-21 year agocat 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 <
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 <
deleted by creator
; was missing