Welcome to LQ---and thanks for acknowledging homework. You'll get some flak regardless, but your approach has the best chance of getting help.
After the wc command, you can use "cut" to select a specific field. "man cut" for details.
For process ID, try this:
ps -e|grep scriptname
Then use cut to get just the process ID
To put command outputs into variables, there are two forms:
var=`command` (those are backtics, not single quotes)
to augment whatever text
you are using, go to http://tldp.org
and get "Bash Guide for Beginners"