jhalfs: Ready to go.

Jeremy Huntwork jhuntwork at linuxfromscratch.org
Mon Oct 17 12:53:58 PDT 2005


Seth W. Klein wrote:
> 
>     case $i in *groff)

Manuel, do you mind if we switch over to this method of string 
comparisons in jhalfs? David's method is nice, but the syntax Seth 
suggests is easier to read and doesn't result in forks. Also it doesn't 
require a specific string format.

For example:
'if [ ${i:4:11} = "bootscripts" -o ${i:4:6} = "kernel" ] ; then
	do something
else
	do something else
fi'

becomes:

'case $i in
   *bootscripts* | *kernel*)
	do something
	;;
   *)
	do something else
	;;
esac'

Can't think why I didn't think of this before, seeing that jhalfs' input 
parser already uses the case syntax...
Oh well.

--
JH



More information about the lfs-dev mailing list