On Thu 14 Feb 2002 at 04:24:39 +0000, you wrote:
> I tried:
> export IFS=:
>
> grep eric /etc/passwd |awk '{print $5}'
>
> still not working. I'm just trying to print 5th field from /etc/passwd
> that will show users full name.
>
> Maybe You know different way of doing this, if so please let me know.
> Thanks again for Your time.
How about changing the field separator in awk, rather than in bash?
You could also so away with the grep while you're at it:
awk '{FS=":"; if ($5 ~ /eric/) {print $5}}' /etc/passwd
Ian
--
Ian Macdonald | Today is a good day for
ian@caliban.org | information-gathering. Read someone else's
| mail file.
|
|