function psapp() {
ps -ax | grep -i $1 | grep -i -v "grep.-i.$1" | awk '{print $1}'
}
function killapp() {
kill $(psapp $1)
}The first function lists the process id for the argument that you request. So psapp word will list the process id for word.
Breaking it down, ps -ax lists the processes, piping to grep -i lists just the lines that have the argument you entered. Unfortunately, it also lists grep and the argument, since that's a running process as well. Therefore, the second grep excludes the grep process. Finally, awk parses for the first column. The second function, killapp, takes the process id as an argument and kills the running process.
To kill an app, just type 'killapp appname' ... or partial app name. It's case insensitive to boot!
[Editor's note: I don't have the bash shell, so I haven't tested this one.]

