Link to home
Start Free TrialLog in
Avatar of gouthammp
gouthammp

asked on

Microsoft Windows Services for UNIX 3.5 - Sed

Hi,
I have one bat file calling another bat file having some sed commands.
When I executes the install.bat file for the first time through command promt I am able to call the second file and it also executes it but the problem is the gap between the command I type to run the install.bat and the next command prompt. See Fig 1 and Fig 2 for your reference.
If I execute the same command again without closing the command prompt I am not getting any gaps. See Fig 3 for your reference.This is how i want.
Thanks a lot.
below is my install.bat
 
@echo off
call .\install\tagver.bat 1.3.0c "Image Version 1.3.0 (06/11/2008)" "(c) Copyright 2008 XYZ Systems, Inc." 
echo The deployment is complete. 
@echo on 
 
below is my tagver.bat
 
REM **********************************************************************
REM * This script is used to update the EASe version info in the OS      * 
REM * OEMinfo.ini file.                                                  * 
REM *                                                                    * 
REM * This script should invoked by the script install.bat only.         * 
REM **********************************************************************
 
sed -e "s/^\(Line2=XYZ Application Version\).*$/\1 %1/g" "%SystemRoot%\System32\oeminfo.ini" > "%SystemRoot%\System32\oeminfo.new.ini"
del "%SystemRoot%\System32\oeminfo.ini"
rename "%SystemRoot%\System32\oeminfo.new.ini" oeminfo.ini
 
echo %2 | sed -e "s/\//\\\//g" > "%SystemRoot%\System32\oeminfo.new.ini"
FOR /F %%a in (%SystemRoot%\System32\oeminfo.new.ini) DO ECHO %%a >> %SystemRoot%\System32\oeminfo.new1.ini
set /p MyVar=<%SystemRoot%\System32\oeminfo.new.ini
del "%SystemRoot%\System32\oeminfo.new.ini"
del "%SystemRoot%\System32\oeminfo.new1.ini"
 
echo %MyVar% | sed -e "s/\"/\\\\\"/g" > "%SystemRoot%\System32\oeminfo.new.ini"
FOR /F %%a in (%SystemRoot%\System32\oeminfo.new.ini) DO ECHO %%a >> %SystemRoot%\System32\oeminfo.new1.ini
set /p MyVar=<%SystemRoot%\System32\oeminfo.new.ini
sed -e "s/^\(Line3=\).*$/\1 %MyVar%/g" "%SystemRoot%\System32\oeminfo.ini" > "%SystemRoot%\System32\oeminfo.new.ini"
del "%SystemRoot%\System32\oeminfo.ini"
del "%SystemRoot%\System32\oeminfo.new1.ini"
rename "%SystemRoot%\System32\oeminfo.new.ini" oeminfo.ini
 
echo %3 | sed -e "s/\"/\\\\\"/g" > "%SystemRoot%\System32\oeminfo.new.ini"
FOR /F %%a in (%SystemRoot%\System32\oeminfo.new.ini) DO ECHO %%a >> %SystemRoot%\System32\oeminfo.new1.ini
set /p MyVar=<%SystemRoot%\System32\oeminfo.new.ini
sed -e "s/^\(Line4=\).*$/\1 %MyVar%/g" "%SystemRoot%\System32\oeminfo.ini" > "%SystemRoot%\System32\oeminfo.new.ini"
del "%SystemRoot%\System32\oeminfo.ini"
del "%SystemRoot%\System32\oeminfo.new1.ini"
rename "%SystemRoot%\System32\oeminfo.new.ini" oeminfo.ini
 
 
Oeminfo file under System32
[General]
Manufacturer=XYZ Information Systems, LLC
Model=XYZ Application Server (EASe)
 
[Support Information]
Line1=Enterprise Application Server (Master Image)
Line2=XYZ Application Version 1.3.0c
Line3=Image Version 1.3.0 (06/11/2008)
Line4=(c) Copyright 2008 XYZ Systems, Inc.

Open in new window

Fig1.JPG
Fig2.JPG
Fig3.JPG
ASKER CERTIFIED SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of EE_AutoDeleter
EE_AutoDeleter

I've requested that this question be deleted for the following reason:

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Not enough information to confirm an answer.

If you feel this question should be closed differently, post an objection and a moderator will read all objections and then close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Auto Deleter
Sorry to interrupt your deletion spree - but only answer is a correct and valid answer.