here's my command string, the problem is when i get multiple lines from the passwd file. this only returns the first line's info, the result of the grep seems to put just one space between the lines and the cut thinks that it's looking at one line not 2. i've looked and man grep and man cut to see if there are any switches I should turn on and nothing has worked thus far.
any suggestions to get the second line to echo?
When you execute a command in back quotes or $() the output is stripped of new lines (by the shell). You don't need to cat the file, grep will read it when given the file name on the command line:
For the sake of clarity, lest a newbie be unintentionally misled, when the shell expands the command substitution, it only removes trailing newlines (if there are any); all other newlines are left intact (though they may be treated as field separators if the default value of IFS is in effect and the command substitution is unquoted).