O/P same as on screen

#Random Scripts 4
#Desc:
clear
  echo "1. To see all processes currently running on the system"
  echo "2. To kill any given process"
  echo "Choose between the two"
  read x
  case $x in
  "1")print `ps aux`;;
  "2") echo "Choose a process to be killed"
     read y
check=`ps ax | grep $y`
echo $check;;
  *) echo "You selected wrong option";;
esac

Two things :

(1). I need output when the user enters '1' same as we get when we run command "ps ax" on the comand line.

(2). I want to kill a process which user enters in the variable "Y". But the problem I am facing is I am not able to get how to check for the database session.

amitj:/home/fnb/amitj/scripts1> ps ax |grep isql
 397410 pts/13 A     0:00 grep isql
 495652 pts/15 A     0:00 isql -Utcs2dev -STCSDEV2 -� -c -w300

I will enter 'Utcs2dev' as variable in Y but then how to get the process ID from it , and then only I can use kill -9 PID.

Advise !

(1) Replace "print `blahblah`" with "blahblah", the backtick (`) is really only useful for storing outputs in variables and using them embedded in other commandlines, if you just want to print the result direct to the screen and nothing else, you don't need them.
eg

case $x in
"1") ps aux;;
"2") echo "Choose a process to be killed"

(2) You could use killall to do what you want here but I dislike it as it can do horribly wrong on you if you are not careful.

PIDSIWANTTOKILL=`ps -eo pid,args | awk "/$THINGTOSEARCHFOR/ { print \$1 }"`

Note that if the user puts something silly (like "a" for example) in the THINGIWANTOSEARCHFOR variable, many many many pids can end up in the resultant list.