Help with Swapinfo automation Alert script

I am new to unix scripting (HP-UX) and need to write a script for checking memory usage.

I am using "ipcs -ma" and using "awk" to select specific colums and redirecting output to variable.

/usr/bin/ipcs -ma | awk '{ print $5,$10,$12}' > $TMP_FILE
 
exec < $TMP_FILE
while read line;
do
   OWNER=`echo $line | awk -F '' '{print $1}'`
   SEGSZ=`echo $line | awk -F '' '{print $2}'`
   LPID=`echo $line | awk -F '' '{print $3}'`

However, seems the value of $OWNER is $5,$10,$12 and $SEGSZ / $LPID are empty. Based on what I have, is there something I'm doing wrong for this to happen?

I was able to resolve the issue by codeing the following instead:

OWNER=`echo $line | awk '{print $1}'`
SEGSZ=`echo $line | awk '{print $3}'`
CPID=`echo $line | awk '{print $4}'`

it worked! :b: