Hello,
First post for Newbie as I am stumped. I need to get certain elements for a specific PID from the ps command. I am attempting to pass the value for the PID I want to retrieve the information for as a variable. When the following is run without using a variable, setting a specific PID, there are no errors.
ps -ef | awk '{if ($2 == "3026") print $1 " " $2 " " $3 " " $9 " " $10 " " $11 " " $12 " " $13;}'
If I pass it as a variable that I know contains data, it errors out. Best as I can tell, the data isn't being read.
ps -ef | awk '{if ($2 == $mFName) print $1 " " $2 " " $3 " " $9 " " $10 " " $11 " " $12 " " $13;}'
The only thing that I can think that is happening is that the command is running outside of the main script and I need to pass the value to it in some way. I just haven't been able to figure out how to do it.
I then want to pass the results to a variable that I can use.
Can anyone point the way or provide an alternate explanation? Any assistance would be greatly appreciated.
)