M
MegaC
Hi all,
I am trying to create a installation script for our product at work.
The script involves prompting the user for the pathname of Apache (and
other components not mentioned here). I then plan to take this
user-entered pathname and edit the http.conf file, by globally
replacing all occurances of a place holder called "APACHE_HOME" with a
ms-dos variable containing the install path entitled %APACHE_HOME%.
So, in my ms-dos script, I have something like this:
.....
set APACHE_HOME=%userManualPathofApache%
....
set PERL_EXE=%IPLANET_HOME/bin/shared/library/perl
@rem Above line is the path to the perl version used by iPlanet
....
%PERL_EXE% -wpe s/APACHE_HOME/"%APACHE_HOME%"/ < httpd.conf >
httpd.conf.mod
move /Y httpd.conf.mod httpd.conf
What I want to happen is for the ms-dos script to call perl to
globally replace all occurances of the placeholder APACHE_HOME with
the interpolated variable of %APACHE_HOME% which contains the install
path of Apache (eg. C:/Program Files/Apache/Apache2). However,
because of the backslashes in the directory name, the substution
strips out the /s and leaves C
rogram FilesApacheApache2.
I tried changing the delimiter from a / to a #, by this command:
%PERL_EXE% -wpe s#APACHE_HOME#"%APACHE_HOME%"# < httpd.conf >
httpd.conf.mod
but I still get the resulting substitution of :
C
rogram FilesApacheApache2
I know what your thinking, just get the user to enter C://Program
Files//Apache//Apache2 ... well I tried that and it STILL gives me the
same result of C
rogram FilesApacheApache2 in the httpd.conf file.
Help!! How do I take the user input of 'C:/Program
Files/Apache/Apache2' and use the command of
%PERL_EXE% -wpe s#APACHE_HOME#"%APACHE_HOME%"# < httpd.conf >
httpd.conf.mod
to substitute every occurance of APACHE_HOME with C:/Program
Files/Apache/Apache2 as intended?
Please help! I am so frustrated by this and it seems like it must be
so easy to do!!
Please respond to com.rogers@dmegyesi (for SPAM)
Thanks,
Derek
I am trying to create a installation script for our product at work.
The script involves prompting the user for the pathname of Apache (and
other components not mentioned here). I then plan to take this
user-entered pathname and edit the http.conf file, by globally
replacing all occurances of a place holder called "APACHE_HOME" with a
ms-dos variable containing the install path entitled %APACHE_HOME%.
So, in my ms-dos script, I have something like this:
.....
set APACHE_HOME=%userManualPathofApache%
....
set PERL_EXE=%IPLANET_HOME/bin/shared/library/perl
@rem Above line is the path to the perl version used by iPlanet
....
%PERL_EXE% -wpe s/APACHE_HOME/"%APACHE_HOME%"/ < httpd.conf >
httpd.conf.mod
move /Y httpd.conf.mod httpd.conf
What I want to happen is for the ms-dos script to call perl to
globally replace all occurances of the placeholder APACHE_HOME with
the interpolated variable of %APACHE_HOME% which contains the install
path of Apache (eg. C:/Program Files/Apache/Apache2). However,
because of the backslashes in the directory name, the substution
strips out the /s and leaves C
I tried changing the delimiter from a / to a #, by this command:
%PERL_EXE% -wpe s#APACHE_HOME#"%APACHE_HOME%"# < httpd.conf >
httpd.conf.mod
but I still get the resulting substitution of :
C
I know what your thinking, just get the user to enter C://Program
Files//Apache//Apache2 ... well I tried that and it STILL gives me the
same result of C
Help!! How do I take the user input of 'C:/Program
Files/Apache/Apache2' and use the command of
%PERL_EXE% -wpe s#APACHE_HOME#"%APACHE_HOME%"# < httpd.conf >
httpd.conf.mod
to substitute every occurance of APACHE_HOME with C:/Program
Files/Apache/Apache2 as intended?
Please help! I am so frustrated by this and it seems like it must be
so easy to do!!
Please respond to com.rogers@dmegyesi (for SPAM)
Thanks,
Derek