# Variable for User Comment

**URL:** <https://community.unix.com/t/variable-for-user-comment/169654>\
**Category:** Shell Programming and Scripting\
**Created:** [March 9, 2007, 11:09am UTC](https://community.unix.com/t/variable-for-user-comment/169654 "2007-03-09T11:09:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gseyforth](https://community.unix.com/letter_avatar/gseyforth/32/5_5575768a8748004e209b776fc1b2916d.png) [@gseyforth](https://community.unix.com/u/gseyforth)\
**Post date:** [March 9, 2007, 11:09am UTC](https://community.unix.com/t/variable-for-user-comment/169654/1 "2007-03-09T11:09:31Z")

</div>

SCO 5.06

Is there a variable that holds a user's comment?  
In scoadmin -account, there's a comment field which we normally  
populate with the user's name.

Or ... am I better off greping /etc/passwd?

Thanks!

---

<div class="post-metadata">

**Author:** ![Perderabo](https://community.unix.com/user_avatar/community.unix.com/perderabo/32/27_2.png) [@Perderabo](https://community.unix.com/u/Perderabo)\
**Post date:** [March 9, 2007, 11:54am UTC](https://community.unix.com/t/variable-for-user-comment/169654/2 "2007-03-09T11:54:10Z")

</div>

I have never seen a variable like that. But try awk rather than grep:  
awk -F: '$1 == "'$USER'" { print $5}' \< /etc/passwd

Cut and paste to be you get the quoting right.

---

<div class="post-metadata">

**Author:** ![gseyforth](https://community.unix.com/letter_avatar/gseyforth/32/5_5575768a8748004e209b776fc1b2916d.png) [@gseyforth](https://community.unix.com/u/gseyforth)\
**Post date:** [March 9, 2007, 1:01pm UTC](https://community.unix.com/t/variable-for-user-comment/169654/3 "2007-03-09T13:01:16Z")

</div>

> [@perderabo](#):
>
> I have never seen a variable like that. But try awk rather than grep:  
> awk -F: '$1 == "'$USER'" { print $5}' \< /etc/passwd
> 
> Cut and paste to be you get the quoting right.

I kinda thought that too, but I gave it a shot ... 🙂

Thanks Perderabo ... that works beautifully.
