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?