Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
need help Writing a script that will print the login name, full name and primary group name using the login names or a sorted list of the same information for those who are currently logged in.
must have the following in script:
1. Allow multiple login names as arguments to the script.
2. Display the login names, full user names and primary group names in sorted order.
3. Support running the script without arguments. In this case the information should come form the users who are currently logged in.
4. Format your output to look like this (the first line is always a header/title):

How far have you gotten on your homework assignment? Please post your efforts so far.
You can look at the /etc/passwd file for the GECOS field for the full name and the GID field for the primary group.
http://linux.about.com/od/commands/...
http://publib.boulder.ibm.com/infoc...
the "id" command will return the UID of the current user.
You will probably use grep and awk for this exercise.

I love requirement #4:
"4. Format your output to look like this (the first line is always a header/title): "
...but he omitted the example. Yep, better make sure that output looks like <null>. Dang kids, do your own homework. But if you're going to ask strangers to do it for you, at least post the full assignment. lol.
http://support.microsoft.com/default.aspx?scid=kb;en-us;555375
How to ask a question.

Hi idontagree,
You can try yourself first, if you stuck somewhere then you have ask help from someothers,
withou trying yourself then you don't learn anything in UNIX.Thanks

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |