Set environment variable with having space linux -


i want set environment variable has space in it. path folder , folder name is: /home/mehrabib/my video

i edit .bashrc , add following line it:

export $video=/home/mehrabib/my\ video 

and run these commands:

echo $video cd $video 

the result is:

/home/mehrabib/my video /home/mehrabib/my :no such file or directory 

i change to

export $video=/home/mehrabib/my\\\ video 

and run these commands:

echo $video cd $video 

the result is:

/home/mehrabib/my\ video /home/mehrabib/my\ :no such file or directory 

what should do?

you should

export video="/home/mehrabib/my video" 

and sum dan's comments do

cd "$video" 

which expand to

cd "/home/mehrabib/my video" 

again.

personally, i've come prefer ${video} syntax.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -