[ipxe-devel] add support for trimming whitespaces from strings

Michael Brown mbrown at fensystems.co.uk
Mon Dec 9 12:22:39 UTC 2013


On 09/12/13 12:02, Christian Hesse wrote:
>> You can exploit the fact that the shell argument parser will
>> automatically strip whitespace.  For example:
>>
>>     # Filter out leading, trailing, and intermediate whitespace from
>> ${product}:
>>     set product ${product}
>
> Hmm, this does not work for me. Is this really supposed to work?
>
> iPXE>  config [set product to "Test    "]
> iPXE>  set product ${product}
> iPXE>  echo +${product}+
> +Test    +
> iPXE>

Sorry; my mistake.  It would have worked prior to commit:

   http://git.ipxe.org/ipxe.git/commitdiff/b5f5f73

I'd prefer not to add an extra setting type to handle this case; it 
seems too specific a task to justify a whole new setting type.

Michael



More information about the ipxe-devel mailing list