Need some scripting help
Hi all you very nice people
I was wondering how you would create a script that will take in a user id as an argument from the command line. I need the script to check if an argument was given and if not, prompt for one. Then, using the userid, the script should obtain the user's name from the /etc/passwd file. THe script should then prompt if the user wants to enter in another userID. If yes, then the process should repeat itself or if not, then the script should exit. Thanks a lot! |
here's a simple example to get started with, it shows how to check if an argument was given and
how to get the username from /etc/passwd, the prompting and looping would have to be added. Code:
#!/bin/bash where column 5 (delimited by colons) is the user name |
All times are GMT -5. The time now is 03:07 AM. |