env variables with spaces

Ben Duncan bns
Tue Feb 27 16:42:46 PST 2007


Most of the time the space should be proceeded by a back slash ...
as in: FOO=release\ debug


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
> 

-- 
Ben Duncan   - Business Network Solutions, Inc. 336 Elton Road  Jackson MS, 39212
"Never attribute to malice, that which can be adequately explained by stupidity"
        - Hanlon's Razor




More information about the Linux-users mailing list