![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Advantage of executing program in user shell? | seeker333 | UNIX for Advanced & Expert Users | 2 | 05-21-2008 02:19 PM |
| Shell Program that prompts for user Id | mmg2711 | UNIX for Dummies Questions & Answers | 1 | 10-24-2007 07:15 AM |
| Shell script answer prompts? | eltinator | Shell Programming and Scripting | 4 | 08-29-2007 11:15 AM |
| pkgadd pkgask still prompts for user input | prkfriryce | SUN Solaris | 1 | 06-28-2007 12:27 PM |
| program running for one user and not for other user | bryan | UNIX for Advanced & Expert Users | 2 | 11-13-2006 11:09 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi
I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is provided then the pathname of the user's home directory must be displayed. If a user ID that is not recognised is entered an error message must be displayed. Any possible solution would gbe greatly appreciated. Thanks in advance! |
|
||||
|
It is not homework but a sample I was given. I dont necessarily have to do it but I would like to see how it is done so I can look at it and try and understand how it works. If anyone has any kind of help at all it would be greatly appreciated. As for the use of functions I'm not sure why they are used. Anyone with help please let me know. Thanks..
Last edited by mmg2711; 10-23-2007 at 11:35 AM.. |
|
||||
|
To get user input use the built-in ksh command read. See a ksh manual about how read works.
After having got the input search through /etc/passwd, there are all the users of this system along with their UIDs. Have a look at this file (it is readable for everybody) and you will surely find out how it is organized. Use the command grep (man grep) to search this file with the given input. bakunin |
|
||||
|
You have just forfeited the last ounce of good will here. If you do not want to do your work yourself, why should we do your work besides our own? The statement i quoted shows, that you are just making wild guesses instead of looking into manpages, educating and informing yourself or otherwise are unwilling to put any effort in finding a solution apart from writing one-liners here supposed to make us providing you with a script you could then pass on as your own.
The bottom line is: this is despicable. bakunin |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|