Results 1 to 3 of 3
Hi! When I try this:
Code:
HTTPD=`locate httpd.conf`
DOCUMENT_ROOT=`more $HTTPD | grep DocumentRoot | grep -v '^#' | awk '{print $2}'`
cd $DOCUMENT_ROOT
I see:
-bash: cd: "/var/www/html": No such ...
- 06-09-2010 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 48
Problem to enter into a directory from value
Hi! When I try this:
I see:Code:HTTPD=`locate httpd.conf` DOCUMENT_ROOT=`more $HTTPD | grep DocumentRoot | grep -v '^#' | awk '{print $2}'` cd $DOCUMENT_ROOT
-bash: cd: "/var/www/html": No such file or directory
I check my outputs and are:
What's exactly happend? Bash can't enter into a directory from value?Code:echo $HTTPD /etc/httpd/conf/httpd.conf echo $DOCUMENT_ROOT "/var/www/html"
thanks!
- 06-09-2010 #2Linux Newbie
- Join Date
- Sep 2004
- Location
- UK
- Posts
- 160
Try
I think it's the double quote marks (")Code:DOCUMENT_ROOT=`more $HTTPD | grep DocumentRoot | grep -v '^#' | awk '{print $2}' | tr '"' ' '`In a world without walls and fences, who needs Windows and Gates?
- 06-09-2010 #3Just Joined!
- Join Date
- Oct 2008
- Posts
- 48
very thanks!


Reply With Quote