Question: Use python, before you start to write the next script, first run the 'who' command at the UNIX prompt and redirect it intoa file named

Use python, before you start to write the next script, first run the 'who' command at the UNIX prompt and redirect it intoa file named users.txt. (Then, look at the file and study its format!) Afterwards, write a program that reads in and uses the 'split' function to break up each line of the 'users.txt' file into three variables: who, where, and when_and_IP, and then reprints it to the screen in this format: who on where at when_and_IP. So, if your text input file contains three lines, I expect to see code that produce three lines of output, each of which will look like: bsd17 on ttyp0 at Aug09 08:07 (132.85.201.182).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!