Can anyone help me in implementing a program which contains a routine which is similar to getpid() in functionality, but there should not be use of getpid() in the program. Please reply as soon as possible.

Since this is in Shell scripting:

pid=$$

$$ returns the pid of the current process (the one the shell is running in)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.