0

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?

1

Use this in .bashrc :

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

Use this to access it :

cd "$xyz"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.