ResinCoreSolder
Technical User
I have three web sites, run Windows XP and Apache server on my development computer. I have three versions of the "httpd.conf" config file stored unser unique names, and wish to build a batch file to delete the working "httpd.conf," copy "version 1 httpd.conf" and paste as "copy of version 1 httpd.conf," rename the copy to "httpd.conf," and start my server. I then go to localhost and find the first of three websites.
OK, so I dig up a good batch file that goes like this:
@echo off
cls
echo.
echo 1 First site
echo 2 Second site
echo 3 Third site
CHOICE /C:123 /N choose >nul
IF ERRORLEVEL == 3 goto THIRD
IF ERRORLEVEL == 2 goto SECOND
IF ERRORLEVEL == 1 GOTO FIRST
THIRD:
echo Selected Third site
pause
commands to delete, copy, paste and rename third version of config file
exit
SECOND:
and so on.
But for Windows not having a CHOICE command from what I could see on a microsoft page, I have no way to do this using the MS-DOS commands that I have been familiar with.
However, as I have Perl installed at C:\usr\bin\perl.exe, which means my Perl programs run on my Windows computer on the Apache server exactly as they do on my Linux Webhost without editing the shebang line, I should be able to run a Windows batch file of Perl commands.
I opened a Windows command window and entered \usr\bin\perl -e 'print"hello"'
and that is followed with:
Can't find string terminator "'" anywhere before EOF at -e line 1.
Another site spoke about backticks and I think that refers to the character left of the 1 key under the tilde. I replaced ' with ` and my message was the same, except now it can't find "`" anywhere.
Can someone please advise me how to begin a batch file in Perl and be able to run it on Windows XP? And what was I doing wrong on that perl -e experiment? I was in Settings and Documents\ ... \My Documents, and maybe I should try that experiment at C:\ or a path without spaces.....
Thanks.
Larry
OK, so I dig up a good batch file that goes like this:
@echo off
cls
echo.
echo 1 First site
echo 2 Second site
echo 3 Third site
CHOICE /C:123 /N choose >nul
IF ERRORLEVEL == 3 goto THIRD
IF ERRORLEVEL == 2 goto SECOND
IF ERRORLEVEL == 1 GOTO FIRST
THIRD:
echo Selected Third site
pause
commands to delete, copy, paste and rename third version of config file
exit
SECOND:
and so on.
But for Windows not having a CHOICE command from what I could see on a microsoft page, I have no way to do this using the MS-DOS commands that I have been familiar with.
However, as I have Perl installed at C:\usr\bin\perl.exe, which means my Perl programs run on my Windows computer on the Apache server exactly as they do on my Linux Webhost without editing the shebang line, I should be able to run a Windows batch file of Perl commands.
I opened a Windows command window and entered \usr\bin\perl -e 'print"hello"'
and that is followed with:
Can't find string terminator "'" anywhere before EOF at -e line 1.
Another site spoke about backticks and I think that refers to the character left of the 1 key under the tilde. I replaced ' with ` and my message was the same, except now it can't find "`" anywhere.
Can someone please advise me how to begin a batch file in Perl and be able to run it on Windows XP? And what was I doing wrong on that perl -e experiment? I was in Settings and Documents\ ... \My Documents, and maybe I should try that experiment at C:\ or a path without spaces.....
Thanks.
Larry