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.
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