Use of curly braces with variables

Hi,
I am new to shell scripting.I have worked somewhat with Perl though.
I am not able to find what the second line does and how does it do.

<code>
FP_RUNNING=`service filepool status`
FP_RUNNING=${FP_RUNNING%% *}
<\code>

After the first line,the variable FP_RUNNING stores '1 FilePool software is running.' If I print its value now,that is what it prints.But after executing the second line the variable holds '1'. I have searched the web for this kind of usage and syntax but could not find.Please help me.

Thanks in advance.

Hi,

${string%substring}

Delete the match more longest than find from substr into string. This match goes from begin of the string to the end.

In your case, i think, it find in the string the first blank space and delete all until the end of the string

Sorry for my english...

${FP_RUNNING%% *}

deletes spaces (indicated by ' *') from the end of ${FP_RUNNING}.

${name%%pattern}
    If pattern matches the end of the value of parameter name,
    the matched text is deleted from the result of substitution.