[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

bash scripting question (variables and spaces)



Hi,

I have once again come upon bash problem I can't solve. I'm writing a
little bash frontend and one of the programs expects a option that includes
spaces and is composed from two other shell var's. Example:

#!/bin/bash
A="Hello"
B="Karsten"
C=$A $B 
someprog --greeting $C

Whatever I do now, --greeting receices only the "Hello" part. I've
tried some other variants too:

C="$A $B"
C=\"$A $a\B"
C='$A $B'
C=$A\ $B
C=`echo $A $B`

What works is 
someprog --greeting "Hello Karsten"
but that's no solution.

Please help :-)

Karsten

-- 
Karsten Heymann <karsten.heymann@gmx.de> <karsten@ecology.uni-kiel.de>
CAU-University Kiel, Germany
Registered Linux User #221014                  (http://counter.li.org)



Reply to: