[prev] [thread] [next] [lurker] [Date index for 2005/04/27]
* On 2005.04.27, in <20050427051010.GA13839@xxxxxxxx.xxxxxxx.xxx>, * "Michael G Schwern" <schwern@xxxxx.xxx> wrote: > > You can see this in the tchrist's zen-like implementation of true in PPT. > http://ppt.perl.org/commands/true/true.simple When I settled on using bash as a login shell about 9 years ago, I used a lot more of my computer's available resources than I do now and was somewhat focused on eliminating anything that was not necessary. So I put these into my bashrc, where they've been floating since: true () { return 0 } false () { return 255 } yes () { forever echo ${*-yes} } forever () { while "$@"; do :; done } I didn't want to spare the fork() overhead. I think I found myself far too often battling machines with full process tables, or deeply entrenched in swap hell. (I miss those old SCSI disks. You could always tell when one went to swap hell, from across the room. Now you need software to tell you that, and we all know where that leads.) There's a hate. Why can't I reserve some of those core resources for emergency situations, like a minfree on memory? I don't have to worry about full process tables anymore, and that's great, but we still get full memory. I want priority memory, where priority == "I'm telling you it's priority". This is when I learned to hold some open interactive shells in reserve on critical machines, so that if all else failed and I still couldn't fork(), at least I could still exec reboot. The modern-day bad habit consequence of this is that I never log out of machines unless the terminal discipline gets fried and I can't fix it. So I have 103 screen(1) sessions open. Which I used to hate, because maneuvering among more than a few screen sessions is a monstrous PITA, and screen really needs some attention in that area, but now I've got workarounds and who wants to go needling around in screen? What a wretched hive of scum and villainy that is. I also learned to renice -5 $$ all my root login shells as a matter of routine. Hey, when did bash make true and false builtins? -- -D. dgc@xxxxxxxx.xxx NSIT University of ChicagoThere's stuff above here
Generated at 23:00 on 01 May 2005 by mariachi 0.52