I have an ant task, and inside it I want to get the current process identifier (a la echo $PPID from the command line).
I am running ksh on Solaris, so I thought I could just do this:
<property environment="env" /> <target name="targ"> <echo message="PID is ${env.PPID}" /> <echo message="PID is ${env.$$}" /> </target>
But that did not work; variables are not replaced. Turns off PPID , SECONDS , and some other env variables do not fall into the ant view.
Next I try:
<target name="targ"> <exec executable="${env.pathtomyfiles}/getpid.sh" /> </target>
getpid.sh as follows:
echo $$
This gives me the PID of the generated shell script. Closer, but not quite what I need.
I just need my current process id, so I can make a temporary file with this value in the name. Any thoughts?
source share