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
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to