Computing.Net > Forums > Unix > Unix script ??

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Unix script ??

Reply to Message Icon

Name: idontagree
Date: June 17, 2009 at 13:47:17 Pacific
OS: Unix
Subcategory: General
Comment:

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):



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: June 17, 2009 at 14:08:23 Pacific
Reply:

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.


0

Response Number 2
Name: lowhanginghoney
Date: June 17, 2009 at 14:45:49 Pacific
Reply:

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.


0

Response Number 3
Name: psiva_unix
Date: June 25, 2009 at 11:47:34 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Unix script ??

Unix Script ignoring cmd line vars www.computing.net/answers/unix/unix-script-ignoring-cmd-line-vars/6193.html

Run a Unix Script from VB or ASP www.computing.net/answers/unix/run-a-unix-script-from-vb-or-asp-/4384.html

help redoing unix script student db www.computing.net/answers/unix/help-redoing-unix-script-student-db/5151.html