Hi every one!
I tried to save a long directory into an environmental variable to use it afterwards, but it seems that "cd" command lose its ability to read symbolic characters. For clarity, I put an screen-shot into an attachment. Thanks in advance.
"cd" space in variable problem!
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
"cd" space in variable problem!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: "cd" space in variable problem!
Code: Select all
cd "$CPP"
Re: "cd" space in variable problem!
You quote them...
/home/mute/Desktop/C++/C++ Primer (beginner)
Code: Select all
CPP="/home/mute/Desktop/C++/C++ Primer (beginner)"
mkdir -p "$CPP"
cd "$CPP"
pwd
Re: "cd" space in variable problem!
Thank you guys! It worked. However I couldn't understand why the backslash didn't function as a "space character definer " in this case!!