cat vs sed vs awklemmy.sdf.orgimage sebastiancarlos ( @sebastiancarlos@lemmy.sdf.org ) Linux@lemmy.ml • edit-21 year ago message-square18fedilinkarrow-up126
arrow-up126imagecat vs sed vs awklemmy.sdf.org sebastiancarlos ( @sebastiancarlos@lemmy.sdf.org ) Linux@lemmy.ml • edit-21 year ago message-square18fedilink
minus-square narshee ( @narshee@iusearchlinux.fyi ) linkfedilink3•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 <