View Full Version : BASH: Text string variable with spaces

September 29th, 2007, 03:56 PM
I'm quite confused with this. This

variable="Hello there!"
echo $variable

makes the variable return "Hello there!", like it should, but in this code

showopt=", "$showopt"Test Archive"

(showopt is blank at this point)
it seems to return "," meaning it ignored everything after the space. How might I fix this!?!?!:confused:

September 29th, 2007, 04:15 PM
for me:

showopt=", "$showopt"Test Archive"
echo $showopt


, Test Archive

Are you sure it is only returning ", "? Is there anything else in your script that might affect this?

September 29th, 2007, 04:16 PM
Well, here's the whole script:

*I'm sorry, please see the main page (signature)*

In theory, it should work, shouldn't it?!!

September 29th, 2007, 04:26 PM
I've done a little more testing, and found it's a zenity problem rather than BASH.