comparing PID values of 2 Files in shell Options

Hi,

There is a file having a list of running PIDs and another file having
a list of registered PIDs. How can we check if each value of running
PIDs are less or more than the registered PIDs i.e. comparing the
value of each PID in both the files.

Request you to pls give your inputs.

Thanks a lot in advance.

This doesn't make a lot of sense to me. PID's change as processes create new children, end, etc.

try awk:

awk ' 
       if FILENAME=="regfile" {i++; arr=$1}
       if FILENAME=="pidfile" { if (arr[$NR] > $1 { print $1, " is greater than ", arr[$NR]}
                                     if (arr[$NR] > $1 { print $1, " is less than ", arr[$NR]}
                                     if (arr[$NR] = $1 { print $1, " is  equal to ", arr[$NR]}

        } ' regfile pidfile

Apart from equality, what do less and more tell you about pids? It tells me more about the scripter than anything truely useful about the pids.