better envvar splitter
[k8jam.git] / doc / beer / Jamfile.beer1
blob07ebc7079b81c831869f42b836ae4e2b492423be
1 # Jamfile for 99 Bottles of beer on the wall.
2 # David Brandon (brandon@aspentech.com)
4 ALWAYS beer ;
7 rule SorSS {
8   if $(1) = 1 { return "" ; } else { return "s" ; }
11 rule Drink {
12   local beers b ;
14   beers = 99 ;
15   while $(beers) != 0 {
16     b = [ SorSS $(beers) ] ;
17     Echo "$(beers) bottle$(b) of $(<) on the wall, $(beers) bottle$(b) of $(<)." ;
18     beers = [ ExprI1 $(beers) - 1 ] ;
19     if $(beers) = 0 {
20       Echo "Take one down and pass it around, no more bottles of $(<) on the wall." ;
21       Echo ;
22       Echo "No more bottles of $(<) on the wall, no more bottles of $(<)." ;
23       Exit "Go to the store and buy some more, 99 bottles of $(<) on the wall." ;
24     } else {
25       b = [ SorSS $(beers) ] ;
26       Echo "Take one down and pass it around, $(beers) bottle$(b) of $(<) on the wall." ;
27       Echo ;
28     }
29   }
33 Drink beer ;