On 05/09/12 19:35, Kevin Chadwick wrote: > On Wed, 9 May 2012 12:30:34 +0200 > Nicolas Sebrecht wrote: > >> You should turn them all in things like: >> >> mkdir /sys 2> /dev/null 2>&1 >> cd /sys || { >> ewarn "<the error message>" >> return 1 >> } > That's just a little less racy and certainly not > atomic, /usr/bin/install would be atomic. As you have said > your race point doesn't actually matter. You call it plain wrong and > admit there is nothing wrong at the same time? Well, the problem here is - that script will be the only one running, and the only one manipulating sysfs, and it's fail-safe - if anyone else creates the directory we still end up in a state where it exists (modulo permissions) So yes, it's technically racy and could fail, but all failure modes are benign (directory already there, directory really already there) or really confusing (we can't create a dir - is / mounted readonly? Why are we being run then?!), so either it's good or something really bad you can't catch anyway. > > There's another point, shell is easily editable and understandable and > that's a good thing and not a bad one and also one of arches values I > believe, hence pacman uses so much shell! And it's on-the-fly editable. If you just need to disable that check for a minute because ... err ... long story, but you have to do it ... trivial. And sh -x gives you an instant "debugger" that makes finding silly mistakes a lot easier. > > On occasions I have had to resort to editing shell init scripts because > I don't agree with the distro or devs. People shouldn't be forced to > Gentoo and damaging the environment. Wat :) I presume you got distracted and meant to write something else, otherwise I have to claim that you are a donkey ;) Thanks for the most surreal quote of the day (so far) Take care, Patrick