Create a program called get_name.pl and save it on the UISACAD5 server in a folder named project3. This program reads the passwd.bak file in the /etc directory on the UISACAD5 server, queries a username and returns the user ID and the user's home directory. The relevant fields are fields number two and number five in the /etc/passwd.bak. Start counting the first field or column as zero, then one, then two, etc. The fields are separated by a colon.
The program can be run by calling the program name followed by one argument or parameter; that is, enter the program name and the username (UIS account) in the command line. For example,
$get_name.pl username
The screen output would be:
User ID: user's ID number
Home directory: /home/username
If the username is not found, the screen output would be:
User: username does not exist.
If there is no argument or if more than one argument is entered, the screen output would be:
Please enter one argument only.