On Tue, Mar 19, 2002 at 20:35:53 +0100, Karsten Heymann wrote:
> A="Hello"
> B="Karsten"
> C=$A $B 
> someprog --greeting $C

Variable expansion happens first:
        someprog --greeting Hello Karsten
then tokenising, so someprog get three arguments:
        1. --greeting
        2. Hello
        3. Karsten
whereas you want it to get two arguments:
        1. --greeting
        2. Hello Karsten
in which case you need double quotes around $C to prevent it from being
split into multiple tokens:
        someprog --greeting "$C"

HTH,
Ray
-- 
"People should never have been given free will."  Lots of languages.
        Larry Wall on common fallacies of language design

Reply via email to