• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

append a batch file

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using websphere Ant 1.5.2 for my script

I want to edit this batch file

setlocal

set CLASSPATH=e:\progra~1\checks~1\csmm\java\rdrdispatch.jar;e:\progra~1\checks~1\csmm\java\rdrserver.jar;e:\progra~1\checks~1\csmm\java\csmutils.jar;%CLASSPATH%
java -DCSMETRICS_PROPERTIES=e:\\progra~1\\checks~1\\csmm\\java\\rdragent.properties com.checksol.metrics.server.CollectorServer rdrdbsecurity.dat

I want to put

set PATH=C:\Progra~1\WebSph~1\AppSer~1\java\jre\bin\;%PATH%

between setlocal and SET CLASSPATH

I try to use <concat> and echo tags but i don,t know exactly how to do that.

Saad
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you saying you want to use ant to edit a batch file with these contents:


setlocal

set CLASSPATH=e:\progra~1\checks~1\csmm\java\rdrdispatch.jar;e:\progra~1\checks~1\csmm\java\rdrserver.jar;e:\progra~1\checks~1\csmm\java\csmutils.jar;%CLASSPATH%
java -DCSMETRICS_PROPERTIES=e:\\progra~1\\checks~1\\csmm\\java\\rdragent.properties com.checksol.metrics.server.CollectorServer rdrdbsecurity.dat



and the edit you want to do it to insert a line between the two existing lines?

Why do you want to do this? You only need the PATH in some versions of the batch file?
 
Muhammad Ahsan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on the Automation of a big system , the system consist of
lot of jacl scripts, batch files and Ant files. Instead of using perl for
text processing, I choose Ant , since we are already using ant for automating a build.

Saad
 
Muhammad Ahsan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You only need the PATH in some versions of the batch file?

What do you mean by that , please explain with an example ! I will really apprecaite that

thanks
Saad
 
Carol Enderlin
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to confuse you. I was just trying to figure out why you needed to use ant to put a path line in the batch file. The example is so simple I'm thinking if you need it there just put it there. Now if you need different values there for different environments I can see how ant can help with filters/tokens. Or maybe you need that path in LOTS of places and you only want to have to change it in one place when necessary.

Ant uses a token separator as @, put values in text files that you want replaced using the separator and a token such as "SOME_PATH":

file needs path:
@SOME_PATH@

properties file or build file defines replacement values
SOME_PATH=...put info here...


see ant manual,
e.g., Replace Task or Copy Task.

This example is from a build file that I inherited, just to show you're not limited to replacing a simple property value:

From copy task info in ant manual:

Copy a set of files to a directory, replacing @TITLE@ with Foo Bar in all files.


I hope that points you in the right direction.
[ February 25, 2005: Message edited by: Carol Enderlin ]
 
You can't expect to wield supreme executive power just because
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic