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

Christian Hesse list at eworm.de
Mon Dec 9 12:39:16 UTC 2013


Michael Brown <mbrown at fensystems.co.uk> on Mon, 2013/12/09 12:22:
> 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.

Any other idea?

Would you accept a patch to introduce a command "trim" that removes leading
and trailing white spaces?
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Chris           get my mail address:    */=0;b=c[a++];)
putchar(b-1/(/*               gcc -o sig sig.c && ./sig    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20131209/873730b1/attachment.sig>


More information about the ipxe-devel mailing list