How to reduce code.....

Hi All,

Could some one help me to reduce the code...

if [ $wordsize -eq 2 ]
then
./plist -m "$queuename" |grep $2|awk '{print $3}' >unlock.log
elif [ $wordsize -eq 3 ]
then
./plist -m "$queuename" |grep $2|awk '{print $4}' >unlock.log
else
./plist -m "$queuename" |grep $2|awk '{print $5}' >unlock.log
.
.
.
.

Cheers
Harsha

In your shell man pages (e.g. 'man ksh') search for 'case'