#/bin/bash
ps -ef | awk '/pmon/ && ! ( /bash/ || /grep/ || /perl/ || /asm/ || /MGMT/) {print $1,$8}' |
while read USERNAME ORACLE_SID
do printf 'USERNAME="%s", ORACLE_SID="%s"\n' "$USERNAME" "$ORACLE_SID"
# Do whatever else you want to do with these two variables.
done
However, if the script you showed us produces the output you showed us, it means that $1 or $8 in the script expands to an empty field (and I would assume that it would be the 8th field that is empty.
The code above assumes that you know that the 1st and 8th fields contain the data you want and that the code you showed us is not exactly what you ran. If that assumption is not correct, we need to see the output produces by ps -ef and we need to know what output you are hoping to extract as a result of running your script. Since line is never set in the script you showed us, the USERNAME and ORACLE_SID shell variables script are probably being set to empty strings (unless line is set to some non-empty string in the environment inherited by your script).
The behavior of awk can also vary from system to system. Please also tell us what operating system you're using so we can better understand what you're trying to do.
With all those exclusions, is "pmon" the right thing to match? And, as the first field in ps 's IS the (already known and matched for?) username, do you really need to obtain it from your script?