jhalfs: Ready to go.

David Fix otqzyrn02 at sneakemail.com
Fri Oct 14 11:17:06 PDT 2005


lfs-dev-bounces at linuxfromscratch.org wrote:
> El Viernes, 14 de Octubre de 2005 19:52, David Fix escribió:
> 
>> You bet.  :)  Just remember to change the -5 to whatever the length
>> of the command is that you're checking against.  :)
> 
> The number means the lenght of the string after the - right?

Correct...  The length of the string you're comparing it to...

So, some examples:

------------
if [ ${i: -5} = "groff" ] ; then {do something} ; fi

if [ ${i: -4} = "bash" ] ; then {do something} ; fi

if [ ${i: -6} = "expect" ] ; then {do something} ; fi

if [ ${i: -3} = "tcl" ] ; then {do something} ; fi
------------

I don't know if these examples are all correct names, but it gives you the
general idea.  :)

	Dave




More information about the lfs-dev mailing list