Firstly, please use the
BB code tags when posting code/data samples.
Code:
awk '
# if there's a "rpc-100083" pattern found anywhere on a current line, assign a
# second field ($2) a string "enable -r"
/rpc-100083/ { $2 = "enable -r" }
# if a THRIRD field ($3) contains a pattern ".NOS99dtlogin", then swap the
# values in the SEND and the THIRD fields. Most likely you meant "t" and
# not "$t" variable as a temp place holder.
$3 ~ /.NOS99dtlogin/ { t = $2; $2 = $3; $3 = t }
# print the current record/line
{ print }' /var/svc/profile/upgrade \
>/var/svc/profile/upgrade.new
# Above: output the result to "upgrade.new" file
# move "upgrade.new" to "upgrade"
mv /var/svc/profile/upgrade.new /var/svc/profile/upgrade