Clutch1994
04-29-2001, 02:18 AM
I hope someone can help me with this, I would appreciate it.
I am trying to write a script that takes a user's name as input, and if the
username exists, the script will print out each of the 7 fields of the
/etc/passwd file for that user. It has to use positional parameters and has to
check to make sure the correct number of arguments exist. For example, if the
script is named userinfo, and the username is johnson, I am supposed to be able
to enter:
./userinfo johnson
And get:
username: johnson
password: x
User ID: 500
Group ID: 500
Comment Doug Johnson
Home Dir: /home/johnson
Shell: /bin/bash
Can anybody tell me how I go about doing this? Thank you.
clutch1994@aol.com :confused:
I am trying to write a script that takes a user's name as input, and if the
username exists, the script will print out each of the 7 fields of the
/etc/passwd file for that user. It has to use positional parameters and has to
check to make sure the correct number of arguments exist. For example, if the
script is named userinfo, and the username is johnson, I am supposed to be able
to enter:
./userinfo johnson
And get:
username: johnson
password: x
User ID: 500
Group ID: 500
Comment Doug Johnson
Home Dir: /home/johnson
Shell: /bin/bash
Can anybody tell me how I go about doing this? Thank you.
clutch1994@aol.com :confused: