Write a program called home that takes the name of a user as its single argument and prints that user's home directory. Specifically

home steve
should print
/users/steve
if /users/steve is steve's home directory. (Hint: Recall that the home directory is the sixth field stored in the file /etc/passwd.)

There are a number of ways to accomplish this, here's a solution that uses cut:
grep "^$1\:" /etc/passwd | cut -d: -f6

Computer Science & Information Technology

You might also like to view...

A smartphone is a mobile phone that has Internet connectivity and is able to browse and interact with websites online

Indicate whether the statement is true or false

Computer Science & Information Technology

Observing ________, their physical environment, and their interaction with their physical, ergonomic environment is an important unobtrusive method for a systems analyst.

A) software developers B) administrative assistants C) decision makers D) receptionists

Computer Science & Information Technology