5 ms·
"Many of these utilities are approaching 30 years old and include revisions by many people over the years." "They are not designed for long life or to scale be
by 1vuio0pswjnm7 3y ago
"Many of these utilities are approaching 30 years old and include revisions by many people over the years."
"They are not designed for long life or to scale beyond their role."
Would love to see some examples from the author of programs he believes are "designed for long life" that have been around 30 years.
Or even ones he thinks will be around for 30 years.
- radlad 3y agoI think perhaps the author meant "long development life." As in, they are basically write-once utilities. Part of the benefit of doing "one thing well."
- remexre 3y agoI think that was meant to be understood in context as "meant to be actively developed" (as opposed to maintained) for a long time. The practices the author lists are ones that in larger programs would typically be criticized for damaging maintainability as the program grows.
- matheusmoreira 3y agoWell, what exactly is their role? Is there a limit to what we can do with these things? To test a little programming language I made, I created a testing framework with bash and coreutils. I felt guilty about not using a "proper" language at first but it works so well. In parallel too. I found that the the only thing I couldn't test was the argv[0] of the program. No matter how much I twisted the programs, I couldn't get them to do exactly what I wanted. So I sent a feature request and a patch to coreutils to give env this feature: https://lists.gnu.org/archive/html/coreutils/2023-08/msg00060.html https://lists.gnu.org/archive/html/coreutils/2023-08/msg0006... Looks like it's gonna make it in. A new feature for this old program.
- 1vuio0pswjnm7 3y agohttps://cr.yp.to/ucspi-tcp/argv0.html https://cr.yp.to/ucspi-tcp/argv0.html
- matheusmoreira 3y agoNot part of coreutils though. I want to keep my dependencies to a minimum. The GNU coreutils are ubiquitous.
- nrabulinski 3y agoYou could’ve used bash’s exec which allows specifying argv0
- matheusmoreira 3y agoI did try it. Didn't work in combination with env. # Sets PWD and SHLVL and the latter apparently can't be unset env -i VARIABLE=value bash -c 'exec -a program ./program' # Sets env's argv0, not my program's bash -c 'exec -a program env -i VARIABLE=value ./program' # SHLVL still set env -i bash -c 'unset SHLVL; unset PWD; exec -a program ./program' # SHLVL and _ still set env -i zsh -c 'unset _ HOME PWD LOGNAME SHLVL OLDPWD; ARGV0=program The original discussions, linked from my post: https://lists.gnu.org/archive/html/coreutils/2023-03/msg00002.html https://lists.gnu.org/archive/html/coreutils/2023-03/msg0000... https://lists.gnu.org/archive/html/coreutils/2023-03/msg00010.html https://lists.gnu.org/archive/html/coreutils/2023-03/msg0001...
- gnubison 3y agoWhy do you need to remove all of these from the environment?
- matheusmoreira 3y agoTo test my programming language. It's a freestanding lisp interpreter that doesn't link to libc. I wrote the code that handles the environment variables and in order to test it I needed full control over the program's inputs including its environment. The env utility provides this control by emptying the environment and setting only the variables I specify, solving 90% of the problem. Only thing I still can't control is argv[0]. With this new feature upstreamed, my test suite will be complete. Here's the code if you wish to take a look: https://github.com/lone-lang/lone#testing https://github.com/lone-lang/lone#testing https://github.com/lone-lang/lone/blob/master/scripts/test.bash https://github.com/lone-lang/lone/blob/master/scripts/test.b... Without env -i, the folllowing tests would not be possible: https://github.com/lone-lang/lone/blob/master/test/linux/environment/specific/environment https://github.com/lone-lang/lone/blob/master/test/linux/env... https://github.com/lone-lang/lone/blob/master/test/linux/environment/specific/input https://github.com/lone-lang/lone/blob/master/test/linux/env... https://github.com/lone-lang/lone/blob/master/test/linux/environment/specific/output https://github.com/lone-lang/lone/blob/master/test/linux/env...
- eesmith 3y agoTeX
- hoosieree 3y agoEmacs?
- IE6 3y agoweirdly I interpreted "long life" as a continually running program vs something that had a very clear input, short lived execution, and a clearly defined output.