Scripting via awk

Hi,
I am trying to understand what is happening here, new to scripting: I have a couple of these, but if I knew what was going on in one I can figure out the rest:

awk '/rpc-100083/ { $2 = "enable -r" }
$3 ~ /.NOS99dtlogin/ { $t = $2; $2 = $3; $3 = $t }
{ print }' /var/svc/profile/upgrade \
>/var/svc/profile/upgrade.new
mv /var/svc/profile/upgrade.new /var/svc/profile/upgrade

Thanks.

Firstly, please use the BB code tags when posting code/data samples.

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

Noted.
Ok, Basically , what is being achieved here, e.g how would this help in placing security measures on Solaris?