> On Mon, 15 Sep 2008 21:25:49 -0300 "Sergio Belkin" <[EMAIL PROTECTED]> > wrote: > > > Hi, I was reading http://kanslozebagger.org/lpi-102-practice-exam and > > I found a good test 102 > [..] > > Talking about bash, what can be said about the following > > functions f1 and f2? > > I can hardly believe that this is a typical example for questions of > LPIC-1. In general functions are rarely used in bash scripts. > > Gruß, > Tobias.
I doubt this particular one is typical, but functions are certainly used in Bash scripts. Particularly so if the script is anything more than a trivial one. On my fedora 9 system, grep -l '^#!' /usr/bin/* 2>/dev/null |wc -l shows 767 files that are probably scripts, of which, incidentally, 93 have less than 10 lines. grep "^[:space:][a-zA-Z].*()" $(grep -l '^#!' /usr/bin/* 2>/dev/null)|wc -l shows evidence of 498 probably functions, or an average of one function for every two scripts. I think that is not exactly rare usage. Ian Shields Ph.D. Linux Technologist, ISV & Developer Relations IBM Corp Research Triangle Park, NC [EMAIL PROTECTED]
_______________________________________________ lpi-discuss mailing list [email protected] http://list.lpi.org/cgi-bin/mailman/listinfo/lpi-discuss
