M
Marv
Hello,
I'm a perl beginner and having trouble with what would appear like a
simple task.
I need to capture PID number from each line into a variable while in a
loop. The help I need is how to get to split each line of the output
so that I get the PID number regardless of how many digits long it is.
The output of ps -x gives me the pid number in the first column,
however it seems to be right justified in this column as such:
2193 ? S blahblah blah
26127 pts/0 S blahblah blah
4513 ? S blahblah blah
So when I try to do a split using a space as the delimiter some of the
variables end up empty.
How could I do this so that I always end up with the PID number?
Thanks,
Marv
I'm a perl beginner and having trouble with what would appear like a
simple task.
I need to capture PID number from each line into a variable while in a
loop. The help I need is how to get to split each line of the output
so that I get the PID number regardless of how many digits long it is.
The output of ps -x gives me the pid number in the first column,
however it seems to be right justified in this column as such:
2193 ? S blahblah blah
26127 pts/0 S blahblah blah
4513 ? S blahblah blah
So when I try to do a split using a space as the delimiter some of the
variables end up empty.
How could I do this so that I always end up with the PID number?
Thanks,
Marv