Implementations of Cat(1) from Various Sources (2018)(github.com)
github.com
Implementations of Cat(1) from Various Sources (2018)
https://github.com/pete/cats
12 comments
Unused variable in plan9 implementation?
https://github.com/pete/cats/blob/master/plan9-cat.c#L22
https://github.com/brho/plan9/blob/89d43d2262ad43eb4b26c2a8d... seems to be a global variable.
https://9fans.github.io/plan9port/man/man3/arg.html also references it.
Used by sysfatal(2):
https://github.com/0intro/plan9-contrib/blob/master/sys/src/...
Also mentioned in sysfatal(2)'s manual:
http://man.cat-v.org/9front/2/perror
https://github.com/0intro/plan9-contrib/blob/master/sys/src/...
Also mentioned in sysfatal(2)'s manual:
http://man.cat-v.org/9front/2/perror
Also used in the beautiful (for those who like being creative with the preprocessor) options parser https://9fans.github.io/plan9port/man/man3/arg.html
Thank you, that bit was very interesting. I like the idea for single threaded applications of having argv0 be a global.
Doesn't have to be single-threaded even. Main writes the pointer at the start, and no one else is going to change it, just read from it.
The plan9 one is short and sweet, but what I don't like is that it doesn't support the dashdash thing that unambiguously marks that rest of the arguments should be interpreted as files and not flags. Needed for reliable defensive shell scripts imo.
You may say "it has no options anyway" but other cats do. And you may want to add options in a future version.
You may say "it has no options anyway" but other cats do. And you may want to add options in a future version.
I thought that’s a GNU-ism that wasn’t in POSIX, but https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1... taught me differently.
Now I think it made it into POSIX only fairly recently (corrections welcome)
(it is a good idea, though)
Now I think it made it into POSIX only fairly recently (corrections welcome)
(it is a good idea, though)
How this GitHub project missed the punning opportunity on calling itself "herding-cats" is beyond me. :-)
Woah:
GNU 782 lines
others 123 average lines
counting only the UNIX cat with the most lines to keep them from messing with the average.aww, cats are cute
[deleted]