`cat` using only bash built-ins, binary-safe (and extremely slow): while LANG=C IFS= read -rd $'\0' -n 1 a; do ([ -z "$a" ] && echo -ne '\x00' || echo -n "$a") ; done <input >output
-
-
Replying to @marcan42
So at least Debian doesn not have the 'cat' builtin packaged. But if you build bash from source including the loadables, you can enable -f ~/src/bash/examples/loadables/cat cat See https://gitlab.com/gnuwget/wget2/wikis/Developer-hints:-Increasing-speed-of-GNU-toolchain … for instructions.
1 reply 1 retweet 1 like
Replying to @ruehsen
Interesting. Though if it's not there by default in typical distro it might as well not exist. The point of my snippet was for weird situations where you have to work with builtins only on an existing system :-)
6:05 AM - 7 Jun 2018
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.