Quantcast
Viewing latest article 17
Browse Latest Browse All 157

Why does unbuffer -p mangle its input?

$ seq 10 | unbuffer -p od -vtc0000000   1  \n   2  \n   3  \n   4  \n   5  \n   6  \n   7  \n   8  \n

Where did 9 and 10 go?

$ printf '\r' | unbuffer -p od -An -w1 -vtc  \n

Why was \r changed to \n?

$ : | unbuffer -p printf '\n' | od -An -w1 -vtc  \r  \n$ unbuffer -p printf '\n' | od -An -w1 -vtc  \r      \n

WTF?

$ printf foo | unbuffer -p cat$

Why no output (and a one second delay)?

$ printf '\1\2\3foo bar\n'  | unbuffer -p od -An -w1 -vtc$

Why no output?

$ (printf '\23'; seq 10000) | unbuffer -p cat

Why does it hang with no output?

$ unbuffer -p sleep 10

Why can't I see what I type (and why is it discarded even though sleep didn't read it)?

Incidentally, also:

$ echo test | unbuffer -p grep foo && echo found foofound foo

How come grep found foo but didn't print the lines that contain it?

$ unbuffer -p ls /x 2> /dev/nullls: cannot access '/x': No such file or directory

Why didn't the error go to /dev/null?

See also Unbuffer converting all characters to bell?

$ echo ${(l[10000][foo])} | unbuffer -p cat | wc -c4095

That's with:

$ lsb_release -aNo LSB modules are available.Distributor ID: DebianDescription:    Debian GNU/Linux trixie/sidRelease:        n/aCodename:       trixie$ uname -rsmLinux 6.5.0-3-amd64 x86_64$ expect -c 'puts "expect [package require Expect] tcl [info patchlevel]"'expect 5.45.4 tcl 8.6.13$ /proc/self/exe --versionzsh 5.9 (x86_64-debian-linux-gnu)

Same on Ubuntu 22.04 or on FreeBSD 12.4-RELEASE-p5 (except the od commands have to be adapted there, and I get 2321 (all BEL characters there) instead of 4095 above).


Viewing latest article 17
Browse Latest Browse All 157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>