jhalfs: Ready to go.

Jeremy Huntwork jhuntwork at linuxfromscratch.org
Sun Oct 16 15:22:32 PDT 2005


Seth W. Klein wrote:
> That is, in the general case, broken due to quoting.  Try:
> 
>     if echo "$i" | grep -q groff ; then ... ; fi
> 
> (grep -q isn't portable, either, but you may not care.)
> 
> In any case, the following is portable and fast.  (Forks are expensive
> and grep is never a builtin.)
> 
>     case $i in *groff) ... ;; esac
> 
> Sometimes it is nice that the ;; can be omitted if there is only one
> case as in:
> 
>     case $i in *groff)
> 	.
> 	.
> 	.
>     esac

Excellent. Thanks for the lesson, Seth. :) I'll definitely be looking at 
this again in the near future.

--
JH



More information about the lfs-dev mailing list