4 ms·
building a cat from scratch That would be an interesting project.
by kjs3 3y ago
building a cat from scratch
That would be an interesting project.
- aleph_minus_one 3y ago> building a cat from scratch > That would be an interesting project. Here is the source code of the OpenBSD implementation of cat: > https://github.com/openbsd/src/blob/master/bin/cat/cat.c https://github.com/openbsd/src/blob/master/bin/cat/cat.c and here of the GNU coreutils implementation: > https://github.com/coreutils/coreutils/blob/master/src/cat.c https://github.com/coreutils/coreutils/blob/master/src/cat.c Thus: I don't think building a cat from scratch or creating a tutorial about that topic is particularly hard (even though the HN audience would likely be interested in it). :-)
- bigstrat2003 3y agoI'm 99% sure that kjs3 was joking about building the kind of cat that goes "meow", not a program. ;)
- kjs3 3y ago100%. And considering the OP mistyped "car" as "cat", I'm really, really hoping aleph_minus_one was making a different kind of attempt at humor, but around here you never know.
- aleph_minus_one 3y agoYou should then alias "cat" to print "meow" instead of concatenating files. ;-) ;-) ;-)
- artsi0m 3y agoBuilding a shell from scratch (or some pre-made starting point) seems to be an exercise in a lot of operating systems courses and also in Tanenbaum's book on Operating Systems. There is this guide, divided in parts: https://github.com/tokenrove/build-your-own-shell https://github.com/tokenrove/build-your-own-shell I think you right, and implementing core utils is a nice exercise in system programming. Maybe, it even can be used to create some automated tasks with tests on codewars. Once upon a time I implemented expr(1) but it was too simple, without regex part.