What's the problem? Seems to work OK for me.
- takes letters as an argument and list all usernames matching the pattern
What's this? This has nothing to do with the script you posted. If you want to do what you say here (list usernames that match a pattern) then try:
cut -f1 -d: /etc/passwd | grep pattern
e.g. list all usernames beginning with a
cut -f1 -d: /etc/passwd | grep '^a'