You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tail: obsolete syntax rejects -cf and accepts more than one f #15517
tail's obsolete f suffix is handled differently from GNU in two ways:
tail -cf FILE (last 10 bytes, then follow) is rejected. clap reads it as -c f, the count f fails to parse, and that error is returned before the obsolete-syntax parser is tried.
More than one f is accepted (-5ff, -cff, +cff), while GNU accepts only one.
$ printf 'abcdefghijklmnop\n' > t.txt
$ tail -cf t.txt # GNU coreutils 9.12
hijklmnop
(keeps following)
$ ./target/debug/tail -cf t.txt # uutils main (bf9513b16)
tail: invalid number of bytes: 'f'
$ echo $?
1
$ tail -5ff t.txt # GNU coreutils 9.12
tail: option used in invalid context -- 5
$ echo $?
1
$ ./target/debug/tail -5ff t.txt # uutils main
abcdefghijklmnop
(keeps following)
The same happens with printf 'abcdefghijklmnop\n' | tail -cf on stdin. tail -c f (separate argument) should still be an invalid count, as in GNU.
Found with behave, which recorded GNU tail's behaviour and replayed it against uutils.
Activity