Reading variable from file variable values

Hi,
Here is the output of lpstat. I would like to read value of Queue which is(abxxxxb1)and status that is DOWN in first line. i dont care what is in second line. any one can help me.thanks
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- -----
abxxxxb1 abxxx DOWN
QUEUED 180 /xxx_home/yyy 1 1 1

lpstat | awk '{if($1=="abxxxxb1") { print $2}}'
lpstat | awk '{if($1=="abxxxxb1") { print $3}}'

thanks but it is not working.i have output in one file please let me know how to read first line first column and third column.thanks

try this...
sed -n '3p' test | awk '{print $1 " " $3}'

Please post the command you typed and the output your received followed by the expected output after filtering or processing. We can gather from your posts that your are monitoring print queues in some detail but need to know what information you need from AIX to perform your role.

ksh - can use read with pipe:

lpstat | grep "^abxxxxb1 " | read queue dev status somefields

[ "$queue" = "" ] && print "no status for abxxxxb1" >&2 && exit 1

[ "$status" != "DOWN" ] && print "abxxxxb1 ok" && exit 0

print "abxxxxb1 is down"

General sh version to use read:

read queue dev status somefields <<EOF
$(lpstat | grep "^abxxxxb1 " )
EOF