env variables with spaces

C M Reinehr cmr
Wed Feb 28 06:41:30 PST 2007


On Tuesday 27 February 2007 18:22, Net Llama! wrote:
> I'm running into an annoying problem.  I'm taking the output from 'env'
> and dumping it to a file (/tmp/env.out), and then running 'source
> /tmp/env.out'.  The problem is that some of the variables in env output
> have values assigned to them with spaces, such as:
> FOO=release debug
>
> When source hits this, it gets confused and assumes that the ' debug'
> portion is something separate from the value of FOO, and barfs:
> bash: release: command not found
>
> Anyone have any suggestions how to get around this?  thanks

Perhaps you could redefine the IFS environment variable just to <newline> 
instead of the default <space><tab><newline> before running source.

cmr
-- 
Debian 'Etch' - Registered Linux User #241964
--------
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC



More information about the Linux-users mailing list