said:
>So AAA.cmd has its PID in the AAA.pid file, yes?
Yes.
>And if you have AAA.cmd running simultaneously in two different windows,
>then the AAA.pid file contains two lines with the two different PIDs,
>yes?
That's one option. Another is to put each in a separate file. The best
implementation is going to depend on what tools you use and what you
really are trying to accomplish.
FWIW, it's a good idea to put all the .pid files in a well known
directory. For OS/2 \tmp is probably as good a place as any.
>Hmm. I can START a shell and give it a .cmd to execute, and that .cmd
>can start my AAA.cmd file. In other words, using some shell that lets
>you stash the PID somewhere (probably some syntax errors in the
>following)
That's way too much work. With 4OS2, it's more like:
REM aaa.cmd
echo %_PID >%[TMP]%@name[%0].pid
... rest of script
The same code works for every script.
>Alternately, I need a WhatsMyPID.exe file which I can run at the
>beginning of each of my .cmd files.
Actually, if you were going to write an exec, it would be
WhatsMyParentsPID.exe, but that's details.
While the QUERECUS package was useful when was released back in 1996, that
was a long time ago. Today there are plenty of other libraries with the
same or more functionality. Many are even free or already installed on
your system. Check your copy of Rexx Tips and Techniques. If your
scripts are REXX, RxProcID from RXU.DLL will work just fine. Also, recent
versions of Warp all support SysQuerySwitchList(). See the FP readme for
details.
>Maybe I'll just make a bunch of cmd.exe copies named cmd-AAA.exe etc.
>Then I'll use cmd-AAA.exe to start AAA.cmd etc. And my PSTAT /C list
>will then be very clear as to which PID goes with which .cmd.
That's a brute force, hard to maintain approach, but it will work.
Steven
--
----------------------------------------------------------------------
"Steven Levine" MR2/ICE 2.41 #10183 Warp4/FP15/14.093c_W4
www.scoug.com irc.webbnet.info irc.fyrelizard.org #scoug (Wed 7pm PST)
----------------------------------------------------------------------
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-help".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 27 |
March |
2004 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.