[comp.sys.amiga.tech] Process IDs in CLI scripts

hurd@atreus.bnr.ca (Scott Hurd) (12/18/90)

Greetings:

	 Is there some easy way to have a shell script under amigados create
and use a filename containing a unique number (preferably the process id)?

	 What I want is the AmigaDos equivalent to the unix shell:


#!/bin/csh -f

cp /dev/tty foo.$$
echo "message" > foo2.$$

send file foo.$$ to a remote machine as a message
send file foo2.$$ to the remote machine as an indication that there is a
                  new message to be read

rm foo.$$
rm foo2.$$

---

where the $$ is automatically substituted for the process ID of the 
running script.  Note that it will not be adequate just to use the CLI
process ID, since it will be the same on successive invocations of the
amigados script, and the remote machine may not have processed the
previous message yet.


I have seen some amigados scripts with <$$> in them.  Is this a process ID of
some sort?  when I execute one of these scripts, I actually get a file
named "xxx<$$>" on my disk.

I am using an Amiga 2000, 1.2 roms, 1.3 enhancer software.

Any information (preferably a sample script which runs) would be greatly
appreciated.  Thanks.

	 Cheers,
	 Scott.
--
Scott W. Hurd,                            | The opinions expressed herein are
Bell-Northern Research, Ottawa, Canada.   | solely mine, and do not reflect the
uunet!bnrgate!atreus!hurd                 | opinion of BNR, nor may they even
"... he who hesitates ... uh, er, ..."    | be opinions at all.