bug-bash
[Top][All Lists]
Advanced

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

Re: Exporting variables containing white space


From: Chris F.A. Johnson
Subject: Re: Exporting variables containing white space
Date: 24 Jun 2002 04:32:44 GMT
User-agent: slrn/0.9.7.3 (Linux)

In article <m3u1o1wwsg.fsf@multivac.cwru.edu>, Paul Jarc wrote:
> Raphael Summers <raphael@cs.man.ac.uk> wrote:
>> export MYMUSIC=/mnt/windows/Documents\ and\ Settings/Administrator/My\ 
>> Documents/My\ Music
>>
>> On attempting to cd to $MYMUSIC, it complains that there does not
>> exist a directory /mnt/windows/Documents\
> 
> Since the variable's value contains whitespace, you must quote the
> variable expansion to avoid word splitting:
> cd "$MYMUSIC"

    Or:
        shopt -s cdable_vars
        cd MYMUSIC

-- 
        Chris F.A. Johnson                              bq933@torfree.net
        =================================================================
        c.f.a.johnson@rogers.com                http://cfaj.freeshell.org
        cfaj@freeshell.org        http://members.rogers.com/c.f.a.johnson



reply via email to

[Prev in Thread] Current Thread [Next in Thread]