[U-Boot] hashtable lib and escaping

Wolfgang Denk wd at denx.de
Fri Nov 2 23:20:10 CET 2012


Dear Mats Kärrman,

please don't top post/full quote.  If needed, please read
http://www.netmeister.org/news/learn2quote.html

In message <ED3E0BCACD909541BA94A34C4A164D4C425D0244 at post.tritech.se> you wrote:
>
> If not correct, then what is this supposed to mean (common/main.c :: builtin_run_command()):
> 
> 		/*
> 		 * Find separator, or string end
> 		 * Allow simple escape of ';' by writing "\;"
> 		 */

As I metioned, this is the _second_ part of escaping, that which
happens when processing the commands.  The first part happens when
reading the environment.

The examples I gave should show pretty well how it works:

> > See here:
> > 
> >         => setenv foo 'echo part one\;echo part two' ; print foo ; run > foo
> >         foo=echo part one;echo part two
> >         part one
> >         part two
> >         => setenv foo 'echo part one\\;echo part two' ; print foo ; run>  foo
> >         foo=echo part one\;echo part two
> >         part one;echo part two
> >         =>

Here is one more:

	=> setenv foo echo part one\\\;echo part two ; print foo ; run foo 
	foo=echo part one\;echo part two
	part one;echo part two
	=>

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Prediction is very difficult, especially of the future.  - Niels Bohr


More information about the U-Boot mailing list