3 ms·
bash builtins only, not even a subshell, binary-complete while LANG=C IFS= read -d '' -r -n 1 x ;do printf '%c' "$x" ;done <dat1 >dat2 At least ksh and zsh ha
by Brian_K_White 3y ago
bash builtins only, not even a subshell, binary-complete
while LANG=C IFS= read -d '' -r -n 1 x ;do printf '%c' "$x" ;done <dat1 >dat2
At least ksh and zsh have equivalent functionality though the details may differ.
Not dash or ancient sh.
I don't pretend it's practical, just possible.
I actually do have a neck beard this month.
- Brian_K_White 3y agoksh almost identical, read -N instead of -n while LANG=C IFS= read -d'' -r -N 1 x ;do printf '%c' "$x" ;done <dat1 >dat2 With -n it handles 0x00 fine but screws up on 0x0A !