chop returns the character choped off, so if you
expect it to print "fred" it won't.
chop "$a" isn't the same thing as
chop $a. You have to pass a variable to chop,
so it can modify it -- what you are passing it is a string
constant that you made which contains the variable.
Snippets of code should be wrapped in
<code> tags not<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).