F
F
fokin_nikolay19892021-07-27 14:55:02
linux
fokin_nikolay1989, 2021-07-27 14:55:02

Is it possible to print the value of the http variable?

Good afternoon, is it possible to somehow display the value of the DocumetRoot variable from httpdb File : /etc/httpd/conf/httpd.conf
If I do grep on the file, it comes out

# cat /etc/httpd/conf/httpd.conf | grep DocumentRoot
# DocumentRoot: The directory out of which you will serve your
DocumentRoot "/var/www/html"
    # access content that does not live under the DocumentRoot

And I want exactly /var/www/htmlwhat to assign to a variable later

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor Taran, 2021-07-27
@fokin_nikolay1989

cat 111.txt | grep ^DocumentRoot |  egrep -o '/.+[^"]'

conclusion
/var/www/html

Now it’s better
^- the beginning of the line,
respectively, will only be due to the fact that the root document begins immediately and not in the content
, and then we do grep again with only
, and then what starts with a slash but not quotes, actually this is our url -o

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question