Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-08-2009, 05:29 AM   #1
Registered: Nov 2008
Posts: 31

Rep: Reputation: 15
Being new to linx and scripting is no easy chore...


I know I have to attempt something so that I can be assisted but on this one I don't know how to even start. Please have mercy...

Write a shell script that takes a uid as an argument and prints out that personís name,
home directory, shell and group number. Print out the name of the group corresponding
to the group number, and other groups that person may belong to. (groups,
awk, cut. Also look at /etc/passwd and /etc/groups).
Old 01-08-2009, 06:04 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
The last sentence is a very good hint. There are man pages for files as well as programs, including "man 5 passwd" and "man 5 group".

You have obvious stated a homework question, and you can't expect people to do the problem for you. You might want to google for the "rute guide" for help getting started learning bash scripting. The "SAG Guide" on the website to learn about how linux works, including the fields of /etc/passwd, /etc/group and /etc/shadow.
Old 01-08-2009, 06:17 AM   #3
Senior Member
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,629

Rep: Reputation: Disabled
This is the max we can help you for your homework...
Old 01-08-2009, 07:52 AM   #4
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741
The above advice is more help than you will typically get from a "cut and paste" homework question. I see from your posting history that this is not your pattern---in the future, always try to show us what you have tried and ask more specific questions. In this case, for example, the question might be:
"I looked in /etc/passwd and could not figure out where the UID is."


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy scripting question - tar tejama Linux - Newbie 3 02-13-2008 12:08 PM
LXer: Shell Scripting, oooh...its easy LXer Syndicated Linux News 0 11-27-2006 09:54 AM
Why is installing a program in Linux such a chore? Cinematography General 47 05-03-2005 06:05 PM
Another easy Bourne Shell Scripting question WinterSt Programming 7 09-02-2004 07:41 PM
Scripting problems - I'm sure this should be easy! webamoeba Linux - Newbie 6 02-03-2004 09:58 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:08 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration