Strategies for question 3 -- looking a scoring matrix effects on alignment length and percent identity.
One way to get this program working is to have it print the ssearch or blastp command, rather than actually running it. Then, you can save the resulting set of commands to a file, and try running one or two lines from that file. Once you have lines that run and produce results, you will know that your sshell script will work.