maybe a peculiar question, but
I came across an odd result when pasting through cat
into a text file (cat > textfile
and signaling EOF by Ctrl+D when done ) on ubuntu linux.
It turns out the stdin line buffer prevents lines exceeding 4k (see Line Buffered Cat)
Neither the options of gnu cat (vs. posix cat) nor usage of stdbuf (stdbuf -i0 -o0 cat > textfile
) resulted in files exceeding 4k.
Obviously I am doing something wrong, since cat
does stdout these kind of files when created with nano or vim quite fine.
I would really like to keep using this convenient way of creating files on the fly or pipeing in to other commands from cli without that limitation.
Thank you
Version: cat (GNU coreutils) 8.28
Edit: it obviously is not cat itself but the way the stdin is buffered in the terminal, however vim and nano manage to switch it of (see also Disable buffering for stdin and stdout using setvbuf())