Help with Shell Script: User Lookup

Hi everyone,

Let me start by stating this question is for homework help (not "help, my boss needs this ASAP")

I have spent the last few days re-visiting this script, and cannot figure out where I am going wrong (something simple I'm sure).

I am to build a script that searches for a user within the ~/SLASH/etc/passwd file, and return the line of the file that contains the user name.

Execution of the script will look like [userlookup.sh bob]

I am sure there are better commands to use, but [cat ~/SLASH/etc/passwd | grep (user input)] is the desired command to display the results. Testing the command at the shell prompt [cat ~/SLASH/etc/passwd | bob] does work, I'm just not sure where I'm going wrong bringing that command to this script:

#! /bin/bash

userName="$1"
output= 'cat ~/SLASH/etc/passwd | grep (userName)'
if [ "$output == "" ]; then
echo "Cannot find user "
else
echo "$output"

fi


The shell returns "no such file or directory" (relates to my 'output' line).
Also returns "Cannot find user", even though "bob" is definitely in the file.
(If inputted name is not found in the file, then "Cannot find user" is returned)

Welcome to the forum!

Homework question should be posted in Homework & Coursework Questions filling in the correct form to its entirety according to the forum rules.

In either case, please show us what you have tried so far to solve this problem on your own, using (CODE) tags where applicable.