Page 1 of 1

Strang Directory $external_c and $internal_c

Posted: Mon Feb 04, 2013 6:57 am
by DarkF@der
Hello,

A client of us seems to have some strangs directory's
I can't acces them with root acces......

ls -la /var/www/vhosts/xxxxxxxxxxxxxxxx.com/httpdocs

drwxrwxrwx 3 webmaster psacln 4096 Jan 23 11:38 $external_c
drwxrwxrwx 3 webmaster psacln 4096 Feb 3 22:15 $internal_c

if i want to acces them like cd $external_c i got redirected to my /root dir :?
I can't acces it or look inside the directory's
How the acces these directory's in linux or deleet these directory?


Thanks in advanced

Re: Strang Directory $external_c and $internal_c

Posted: Mon Feb 04, 2013 11:23 am
by mikeshinn
$ tells the shell that this is a variable, and since the variable is empty its throwing you back to /.

So, the solution is to escape the $ by using the \ meta-character to tell the shell that its a literal character. For example:

cd \$external_c

Re: Strang Directory $external_c and $internal_c

Posted: Tue Feb 05, 2013 5:39 am
by DarkF@der
Thank you :D