New answers tagged posix
That behavior is required by POSIX, and you're safe to rely on it. Another note that you want to set your locale to C to get consistent behavior. In locale with collation elements have the same sorting order, you will have strange result. On GNU system with UTF-8 locale: $ printf '%b\n' '\U2461' '\U2460' | sort ② ① or: $ printf '%s\n' A B a b | sort a ...
Yes. The normative answer can be found here: If the pattern matches any existing filenames or pathnames, the pattern shall be replaced with those filenames and pathnames, sorted according to the collating sequence in effect in the current locale. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13_02
It is not an uncommon limitation, since null-bytes are not used in text files. There is of course a FreeBSD port for GNU patch. For context, just looking at the manual pages for FreeBSD: this is GNU diff, agreeing with the source repository, and is actually a little old (8 years). this is not GNU patch, again agreeing with the source repository. Both ...
patch is designed for text files. Take a look at xxd, which can patch binary files. It should be available for FreeBSD as well.
Note that the problem is not with tail but with head here which reads from the pipe more than the first line it is meant to output (so there's nothing left for tail to read). And yes, it's POSIX conformant. head is required to leave the cursor within stdin just after the last line it has output when the input is seekable, but not otherwise. ...
Top 50 recent answers are included