Phew... thank god for ugly patches while waiting for sync to update! I hope the if doesn't come true that often... I have a feeling if it does my screen will be full of ewarn "Moo"'s.
On Fri, 4 Feb 2005 09:08:39 +0900, Georgi Georgiev <[EMAIL PROTECTED]> wrote: > maillog: 04/02/2005-00:00:41(+0000): Ciaran McCreesh types > > Hi people, > > > > Just a note on how to do if / then / else blocks properly in bash... The > > following style *won't* work, so don't do anything daft like committing > > it to eutils.eclass without testing and h0rking half the tree, okay? > > > > if foo ; then > > # do nothing > > else > > echo "hi" > > fi > > > > You have to have a real genuine statement inside each block. Otherwise, > > bash will cry. > > > > If The Doc existed, which it doesn't, and it wasn't in super-early-draft > > state, which it would be if it did exist, you'd be able to see this at > > [1]. As it is, you'll just have to read the bash docs. > > > > [1]: > > http://dev.gentoo.org/~ciaranm/docs/IGNORE_the-doc/#multiple-selection > > You could mention that a ":" would do the trick: > > if foo ; then > # do nothing > : > else > echo "hi" > fi > > -- > -* Georgi Georgiev -* You got to be very careful if you don't -* > *- [EMAIL PROTECTED] *- know where you're going, because you might *- > -* +81(90)6266-1163 -* not get there. -- Yogi Berra -* > > > -- [email protected] mailing list
