would look up Pizza in pat's phone book, no matter who is running rolo. The program can find pat's phone book by looking at .rolo in pat's home directory.
Add the -u flag to rolo to allow you to look up someone in another user's phone book (provided that you have read access to it). For example:
$ rolo -u pat Pizza
This is another straightforward task, particularly given that a user's home directory can be specified with the shorthand ~username. Here's the mod:
if [ "$1" = "-u" ] ; then
if [ ! -s "~$2/.rolo" ] ; then
echo "Error: user $2 doesn't have a .rolo file or it's not readable."
exit 1
fi
PHONEBOOK="$(cat ~$2/.rolo)"
shift 2 # get rid of the -u and the username
elif [ -s $HOME/.rolo ] ; then
PHONEBOOK=$(cat $HOME/.rolo)
else
: ${PHONEBOOK:=$HOME/phonebook}
fi
You might also like to view...
What is the result of a preorder traversal of the binary search tree created in question 12 above?
What will be an ideal response?
To add additional memory without adding RAM, you could use:
A) disk defragmentation B) Cleanup C) ReadyBoost D) Windows Update
Which rootkit intercepts system calls and modifies them as required?
a. Flea b. T0rm c. Adorn d. LKM
An outlet tester determines whether the wiring is correct
Indicate whether the statement is true or false