On Fri, Dec 19, 2014 at 11:22 AM, Rob Landley <[email protected]> wrote: > On 12/18/2014 09:38 PM, enh wrote: >> This basically brings the catv code into cat (but optionally enabled, >> like the 'big' variant of sort) and adds the missing-from-both -n >> option. There are a couple of options in coreutils cat still missing, >> and a few more still in BSD's cat, but they're pretty useless. > > Do you have an actual use case for these?
i use both cat -v and -n (separately at least). i've never used -e/-E or -t/-T; i just brought them across from catv. one reason i didn't add -b/-s (pun intended) is that i didn't even know they existed. (or the BSD -l and -B.) > I'm curious because when I did catv as a separate command in busybox in > 2006, I did so waiting for somebody to actually complain that it broke a > script. Technically, I'm still waiting, although I don't follow the > busybox list quite so closely these days. i only use them interactively. a script can see non-printable characters just fine anyway, and although i feel like a barbarian if i have to count lines by hand, in a script it's probably easier to maintain a count than it is to parse one. that's also the reason why i don't care that BSD and toybox have a byte-by-byte implementation of the options --- they're only useful (imho) if there's a human reader, and byte-by-byte is plenty fast enough for that. > Posix only defined the -u option, (an option i've never used, nor known anyone use.) > and LSB is so _awesomely_ craptacular > a standard that not only do they not mention "cat" at all, but they > deprecated "ar" (presumably because of Ulrich Dr. Pepper's personal > dislike of static linking). > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cat.html > > http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/cmdbehav.html > > In implementing catv, I was really responding to original bell labs unix > developer Rob Pike's 1983 usenix paper telling the BSD guys they were > full of it (popularly called "cat -v considered harmful"): > > http://harmful.cat-v.org/cat-v/unix_prog_design.pdf > > (I saw > http://www.all-things-android.com/content/pros-and-cons-busybox-android > but he wasn't actually using it for anything either.) interesting. i hadn't seen that. some things are definitely wrong (well, assuming busybox is like toybox/coreutils anyway) and others are out of date, and the most interesting thing to me is "which missing commands are actually causing pain for developers?". 360 symlinks is enough that people will start to notice :-) right now the toybox binary is slightly bigger than the toolbox binary was at its peak, though it offers significantly more functionality, and internal developers have already been pleased to have find, od (!), and truncate. (sadly the most common request seems to be "ooh, does this mean we can have less now?".) > Again, the above is not a "no", just a request for more information. If > we already implement catv, then having it available in cat (via config > option) isn't a big stretch. I'm just curious what use case finally > actually needed it after 8 years... for me, "| cat -v" has always been the least obtrusive "is this misbehaving for reasons i can't see?". yes, there's always hd, but that's a lot noisier and -- going back to -e/-E/-t/-T -- the fact that it thinks that line ends and tabs are non-printable is a disadvantage for that kind of thing. i know there's catv and nl already in toybox, but part of my goal with moving us to toybox is that people's muscle memory should just work. the guy who found find found it by accident, for example. i haven't sent out any kind of announcement yet, and may not even do so if people continue to just be pleasantly surprised (or don't even notice!). http://en.wikipedia.org/wiki/Boiling_frog --elliott _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
