Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What does this script do? What does the file called usernames contain? How would

ID: 3772709 • Letter: W

Question

What does this script do? What does the file called usernames contain? How would you get it? Who might be interested in the script? Is there any important infomation you don't get when it executes?

cat usernames | while read name

do

cd /home/$name 2> /dev/null

echo; echo -n "$name:"

grep "cat/home/dshoemak/.bash_history" .bash_history 2> /dev/null

done

My answer: My guess without trying is the script makes a report that lists what commands a list of users use. The script pulls the information from the .bash_history file. This is particulary useful to sysadmins looking for people who had hacked their systems. However, I'm not sure what information you couldn't get.

Explanation / Answer

it just shows you the usernames file data

and changes dirctory from home to dev/null path

prints the value of variable name

and finally find for the file .bash_history.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote