bashrc script not accepting space in directory name

Posted by faizal on Ask Ubuntu See other posts from Ask Ubuntu or by faizal
Published on 2014-08-23T04:14:47Z Indexed on 2014/08/23 4:27 UTC
Read the original article Hit count: 310

Filed under:

I have added a variable at the end of my ~/.basrc file :

export xyz = /home/faizal/DEV/ADT workspace/xyz

But if i open a new terminal, i get the error :

bash: export: 'workspace/xyz': not a valid identifier

So i try a variety of alternatives :

export xyz=/home/faizal/DEV/ADT\ workspace/xyz
export xyz="/home/faizal/DEV/ADT workspace/xyz"
export xyz="/home/faizal/DEV/ADT\ workspace/xyz"
export xyz='/home/faizal/DEV/ADT workspace/xyz'
export xyz='/home/faizal/DEV/ADT\ workspace/xyz'

They all give me the error when i try cd $xyz:

bash: cd: /home/faizal/DEV/ADT: No such file or directory

What am i doing wrong?

© Ask Ubuntu or respective owner

Related posts about bash